diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-12 18:56:48 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-12 18:56:48 +0200 |
commit | 3397361fd7aeec711167c40b3fbab1e05a53b73d (patch) | |
tree | fe8973b486d73c48f8edefa2d6a040c8d2aa0390 /features | |
parent | 13a66040300241caf234726bfc72ca90ef4c34fd (diff) | |
download | gitlab-ce-3397361fd7aeec711167c40b3fbab1e05a53b73d.tar.gz |
Spinach test for broadcast messages
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'features')
-rw-r--r-- | features/admin/broadcast_messages.feature | 13 | ||||
-rw-r--r-- | features/steps/admin/admin_broadcast_messages.rb | 27 |
2 files changed, 40 insertions, 0 deletions
diff --git a/features/admin/broadcast_messages.feature b/features/admin/broadcast_messages.feature new file mode 100644 index 00000000000..0294b51a7c5 --- /dev/null +++ b/features/admin/broadcast_messages.feature @@ -0,0 +1,13 @@ +Feature: Admin Broadcast Messages + Background: + Given I sign in as an admin + And application already has admin messages + And I visit admin messages page + + Scenario: See broadcast messages list + Then I should be all broadcast messages + + Scenario: Create a broadcast message + When submit form with new broadcast message + Then I should be redirected to admin messages page + And I should see newly created broadcast message diff --git a/features/steps/admin/admin_broadcast_messages.rb b/features/steps/admin/admin_broadcast_messages.rb new file mode 100644 index 00000000000..4dfaac06ae4 --- /dev/null +++ b/features/steps/admin/admin_broadcast_messages.rb @@ -0,0 +1,27 @@ +class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps + include SharedAuthentication + include SharedPaths + include SharedAdmin + + step 'application already has admin messages' do + FactoryGirl.create(:broadcast_message, message: "Migration to new server") + end + + step 'I should be all broadcast messages' do + page.should have_content "Migration to new server" + end + + step 'submit form with new broadcast message' do + fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST' + select '2018', from: "broadcast_message_ends_at_1i" + click_button "Add broadcast message" + end + + step 'I should be redirected to admin messages page' do + current_path.should == admin_broadcast_messages_path + end + + step 'I should see newly created broadcast message' do + page.should have_content 'Application update from 4:00 CST to 5:00 CST' + end +end |