diff options
author | Ciro Santilli <ciro.santilli@gmail.com> | 2014-09-21 23:40:22 +0200 |
---|---|---|
committer | Ciro Santilli <ciro.santilli@gmail.com> | 2014-09-22 10:01:50 +0200 |
commit | ef6e94e37e0fce23acf32992476aeb63405be0c1 (patch) | |
tree | 3cfce6b15bab68f2213850672872de2ce420bae3 /features/steps/dashboard | |
parent | fda61a047ffb9b04bc4dd38e897088fde17fb3c1 (diff) | |
download | gitlab-ce-ef6e94e37e0fce23acf32992476aeb63405be0c1.tar.gz |
Replace old spinach step definitions with step.
Diffstat (limited to 'features/steps/dashboard')
-rw-r--r-- | features/steps/dashboard/dashboard.rb | 28 | ||||
-rw-r--r-- | features/steps/dashboard/event_filters.rb | 18 | ||||
-rw-r--r-- | features/steps/dashboard/projects.rb | 2 | ||||
-rw-r--r-- | features/steps/dashboard/with_archived_projects.rb | 6 |
4 files changed, 27 insertions, 27 deletions
diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb index 84a480bd7f8..92dd2841004 100644 --- a/features/steps/dashboard/dashboard.rb +++ b/features/steps/dashboard/dashboard.rb @@ -3,31 +3,31 @@ class Dashboard < Spinach::FeatureSteps include SharedPaths include SharedProject - Then 'I should see "New Project" link' do + step 'I should see "New Project" link' do page.should have_link "New project" end - Then 'I should see "Shop" project link' do + step 'I should see "Shop" project link' do page.should have_link "Shop" end - Then 'I should see last push widget' do + step 'I should see last push widget' do page.should have_content "You pushed to fix" page.should have_link "Create Merge Request" end - And 'I click "Create Merge Request" link' do + step 'I click "Create Merge Request" link' do click_link "Create Merge Request" end - Then 'I see prefilled new Merge Request page' do + step 'I see prefilled new Merge Request page' do current_path.should == new_project_merge_request_path(@project) find("#merge_request_target_project_id").value.should == @project.id.to_s find("#merge_request_source_branch").value.should == "fix" find("#merge_request_target_branch").value.should == "master" end - Given 'user with name "John Doe" joined project "Shop"' do + step 'user with name "John Doe" joined project "Shop"' do user = create(:user, {name: "John Doe"}) project.team << [user, :master] Event.create( @@ -37,11 +37,11 @@ class Dashboard < Spinach::FeatureSteps ) end - Then 'I should see "John Doe joined project at Shop" event' do + step 'I should see "John Doe joined project at Shop" event' do page.should have_content "John Doe joined project at #{project.name_with_namespace}" end - And 'user with name "John Doe" left project "Shop"' do + step 'user with name "John Doe" left project "Shop"' do user = User.find_by(name: "John Doe") Event.create( project: project, @@ -50,11 +50,11 @@ class Dashboard < Spinach::FeatureSteps ) end - Then 'I should see "John Doe left project at Shop" event' do + step 'I should see "John Doe left project at Shop" event' do page.should have_content "John Doe left project at #{project.name_with_namespace}" end - And 'I have group with projects' do + step 'I have group with projects' do @group = create(:group) @project = create(:project, namespace: @group) @event = create(:closed_issue_event, project: @project) @@ -62,24 +62,24 @@ class Dashboard < Spinach::FeatureSteps @project.team << [current_user, :master] end - Then 'I should see projects list' do + step 'I should see projects list' do @user.authorized_projects.all.each do |project| page.should have_link project.name_with_namespace end end - Then 'I should see groups list' do + step 'I should see groups list' do Group.all.each do |group| page.should have_link group.name end end - And 'group has a projects that does not belongs to me' do + step 'group has a projects that does not belongs to me' do @forbidden_project1 = create(:project, group: @group) @forbidden_project2 = create(:project, group: @group) end - Then 'I should see 1 project at group list' do + step 'I should see 1 project at group list' do page.find('span.last_activity/span').should have_content('1') end diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb index d0fe5c9b64b..51162dbacc4 100644 --- a/features/steps/dashboard/event_filters.rb +++ b/features/steps/dashboard/event_filters.rb @@ -3,31 +3,31 @@ class EventFilters < Spinach::FeatureSteps include SharedPaths include SharedProject - Then 'I should see push event' do + step 'I should see push event' do page.should have_selector('span.pushed') end - Then 'I should not see push event' do + step 'I should not see push event' do page.should_not have_selector('span.pushed') end - Then 'I should see new member event' do + step 'I should see new member event' do page.should have_selector('span.joined') end - And 'I should not see new member event' do + step 'I should not see new member event' do page.should_not have_selector('span.joined') end - Then 'I should see merge request event' do + step 'I should see merge request event' do page.should have_selector('span.accepted') end - And 'I should not see merge request event' do + step 'I should not see merge request event' do page.should_not have_selector('span.accepted') end - And 'this project has push event' do + step 'this project has push event' do data = { before: "0000000000000000000000000000000000000000", after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", @@ -51,7 +51,7 @@ class EventFilters < Spinach::FeatureSteps ) end - And 'this project has new member event' do + step 'this project has new member event' do user = create(:user, {name: "John Doe"}) Event.create( project: @project, @@ -60,7 +60,7 @@ class EventFilters < Spinach::FeatureSteps ) end - And 'this project has merge request event' do + step 'this project has merge request event' do merge_request = create :merge_request, author: @user, source_project: @project, target_project: @project Event.create( project: @project, diff --git a/features/steps/dashboard/projects.rb b/features/steps/dashboard/projects.rb index 85251565446..2b41aa6374e 100644 --- a/features/steps/dashboard/projects.rb +++ b/features/steps/dashboard/projects.rb @@ -3,7 +3,7 @@ class DashboardProjects < Spinach::FeatureSteps include SharedPaths include SharedProject - Then 'I should see projects list' do + step 'I should see projects list' do @user.authorized_projects.all.each do |project| page.should have_link project.name_with_namespace end diff --git a/features/steps/dashboard/with_archived_projects.rb b/features/steps/dashboard/with_archived_projects.rb index 1bc69555b56..3d942107428 100644 --- a/features/steps/dashboard/with_archived_projects.rb +++ b/features/steps/dashboard/with_archived_projects.rb @@ -8,15 +8,15 @@ class DashboardWithArchivedProjects < Spinach::FeatureSteps project.update_attribute(:archived, true) end - Then 'I should see "Shop" project link' do + step 'I should see "Shop" project link' do page.should have_link "Shop" end - Then 'I should not see "Forum" project link' do + step 'I should not see "Forum" project link' do page.should_not have_link "Forum" end - Then 'I should see "Forum" project link' do + step 'I should see "Forum" project link' do page.should have_link "Forum" end end |