Add test for subscribing to a stream.

(imported from commit e006bcfa5f4c5bbabda839470904689ed1ca5a2b)
This commit is contained in:
Waseem Daher 2013-01-07 23:10:47 -05:00
parent 9ecbff26f8
commit 65a474c37c
1 changed files with 12 additions and 0 deletions

View File

@ -285,6 +285,18 @@ casper.then(function() {
casper.click('a[href^="#subscriptions"]');
casper.test.assertUrlMatch(/^http:\/\/[^\/]+\/#subscriptions/, 'URL suggests we are on subscriptions page');
casper.test.assertExists('#subscriptions.tab-pane.active', 'Subscriptions page is active');
casper.waitForText('Denmark'); // subscriptions need to load
casper.test.assertTextExists('Denmark', 'Initial subscriptions loaded');
});
casper.then(function() {
casper.fill('form#add_new_subscription', {streams: 'waseemio'});
casper.click('form#add_new_subscription input.btn.btn-primary');
});
casper.then(function() {
casper.waitForText('waseemio');
// TODO: Make this more robust.
// I tried to do it with assertSelectorHasText, but it wasn't quite working.
casper.test.assertTextExists('Successfully added subscription to waseemio', 'Subscribing to a stream');
});
// Settings page tests