Commit b58155113b46690d9390597f9f1feccf44b00989
1 parent
698500dd
Exists in
master
and in
4 other branches
add spinach steps for remaining features
Showing
16 changed files
with
357 additions
and
24 deletions
Show diff stats
features/project/deploy_keys.feature
features/project/merge_requests.feature
| 1 | -Feature: Merge Requests | |
| 1 | +Feature: Project Merge Requests | |
| 2 | 2 | Background: |
| 3 | - Given I signin as a user | |
| 3 | + Given I sign in as a user | |
| 4 | 4 | And I own project "Shop" |
| 5 | 5 | And project "Shop" have "Bug NS-04" open merge request |
| 6 | 6 | And project "Shop" have "Feature NS-03" closed merge request |
| 7 | - And I visit project "Shop" merge requests page | |
| 7 | + And I visit project "Shop" merge requests page | |
| 8 | 8 | |
| 9 | 9 | Scenario: I should see open merge requests |
| 10 | 10 | Then I should see "Bug NS-04" in merge requests | ... | ... |
features/project/network.feature
| 1 | -@javascript | |
| 2 | 1 | Feature: Project Network Graph |
| 3 | - | |
| 4 | 2 | Background: |
| 5 | - Given I signin as a user | |
| 3 | + Given I sign in as a user | |
| 6 | 4 | And I own project "Shop" |
| 7 | 5 | And I visit project "Shop" network page |
| 8 | 6 | |
| 7 | + @javascript | |
| 9 | 8 | Scenario: I should see project network |
| 10 | 9 | Then page should have network graph | ... | ... |
features/project/project.feature
| 1 | -Feature: Project | |
| 1 | +Feature: Projects | |
| 2 | 2 | Background: |
| 3 | 3 | Given I signin as a user |
| 4 | 4 | And I own project "Shop" |
| 5 | - And I visit project "Shop" page | |
| 5 | + And I visit project "Shop" page | |
| 6 | 6 | |
| 7 | - Scenario: I should see project activity | |
| 7 | + # @wip | |
| 8 | + # Scenario: I should see project activity | |
| 8 | 9 | |
| 9 | - Scenario: I edit project | |
| 10 | + # @wip | |
| 11 | + # Scenario: I edit project | |
| 10 | 12 | |
| 11 | - Scenario: I visit attachments | |
| 13 | + # @wip | |
| 14 | + # Scenario: I visit attachments | ... | ... |
features/project/snippets.feature
features/project/team_management.feature
| 1 | 1 | Feature: Project Team management |
| 2 | - Background: | |
| 3 | - Given I signin as a user | |
| 2 | + Background: | |
| 3 | + Given I sign in as a user | |
| 4 | 4 | And I own project "Shop" |
| 5 | - And gitlab user "Mike" | |
| 6 | - And gitlab user "Sam" | |
| 5 | + And gitlab user "Mike" | |
| 6 | + And gitlab user "Sam" | |
| 7 | 7 | And "Sam" is "Shop" developer |
| 8 | - And I visit project "Shop" team page | |
| 8 | + And I visit project "Shop" team page | |
| 9 | 9 | |
| 10 | 10 | Scenario: See all team members |
| 11 | 11 | Then I should be able to see myself in team |
| ... | ... | @@ -20,7 +20,7 @@ Feature: Project Team management |
| 20 | 20 | Scenario: Update user access |
| 21 | 21 | Given I should see "Sam" in team list as "Developer" |
| 22 | 22 | And I change "Sam" role to "Reporter" |
| 23 | - Then I visit project "Shop" team page | |
| 23 | + Then I visit project "Shop" team page | |
| 24 | 24 | And I should see "Sam" in team list as "Reporter" |
| 25 | 25 | |
| 26 | 26 | Scenario: View team member profile |
| ... | ... | @@ -30,6 +30,5 @@ Feature: Project Team management |
| 30 | 30 | Scenario: Cancel team member |
| 31 | 31 | Given I click link "Sam" |
| 32 | 32 | And I click link "Remove from team" |
| 33 | - Then I visit project "Shop" team page | |
| 33 | + Then I visit project "Shop" team page | |
| 34 | 34 | And I should not see "Sam" in team list |
| 35 | - | ... | ... |
features/project/wall.feature
| ... | ... | @@ -7,11 +7,12 @@ Feature: Project Wall |
| 7 | 7 | Background: |
| 8 | 8 | Given I signin as a user |
| 9 | 9 | And I own project "Shop" |
| 10 | - And I visit project "Shop" wall page | |
| 10 | + And I visit project "Shop" wall page | |
| 11 | 11 | |
| 12 | + @javascript | |
| 12 | 13 | Scenario: Write comment |
| 13 | 14 | Given I write new comment "my special test message" |
| 14 | 15 | Then I should see project wall note "my special test message" |
| 15 | 16 | |
| 16 | - Then I visit project "Shop" wall page | |
| 17 | + Then I visit project "Shop" wall page | |
| 17 | 18 | And I should see project wall note "my special test message" | ... | ... |
features/project/web_hooks.feature
features/project/wiki.feature
| ... | ... | @@ -0,0 +1,27 @@ |
| 1 | +class CreateProject < Spinach::FeatureSteps | |
| 2 | + Given 'I signin as a user' do | |
| 3 | + login_as :user | |
| 4 | + end | |
| 5 | + | |
| 6 | + When 'I visit new project page' do | |
| 7 | + visit new_project_path | |
| 8 | + end | |
| 9 | + | |
| 10 | + And 'fill project form with valid data' do | |
| 11 | + fill_in 'project_name', :with => 'NewProject' | |
| 12 | + fill_in 'project_code', :with => 'NPR' | |
| 13 | + fill_in 'project_path', :with => 'newproject' | |
| 14 | + click_button "Create project" | |
| 15 | + end | |
| 16 | + | |
| 17 | + Then 'I should see project page' do | |
| 18 | + current_path.should == project_path(Project.last) | |
| 19 | + page.should have_content('NewProject') | |
| 20 | + end | |
| 21 | + | |
| 22 | + And 'I should see empty project instuctions' do | |
| 23 | + page.should have_content "git init" | |
| 24 | + page.should have_content "git remote" | |
| 25 | + page.should have_content Project.last.url_to_repo | |
| 26 | + end | |
| 27 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,15 @@ |
| 1 | +class Projects < Spinach::FeatureSteps | |
| 2 | + Given 'I sign in as a user' do | |
| 3 | + login_as :user | |
| 4 | + end | |
| 5 | + | |
| 6 | + And 'I own project "Shop"' do | |
| 7 | + @project = Factory :project, :name => "Shop" | |
| 8 | + @project.add_access(@user, :admin) | |
| 9 | + end | |
| 10 | + | |
| 11 | + And 'I visit project "Shop" page' do | |
| 12 | + project = Project.find_by_name("Shop") | |
| 13 | + visit project_path(project) | |
| 14 | + end | |
| 15 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,102 @@ |
| 1 | +class ProjectMergeRequests < Spinach::FeatureSteps | |
| 2 | + Then 'I should see "Bug NS-04" in merge requests' do | |
| 3 | + page.should have_content "Bug NS-04" | |
| 4 | + end | |
| 5 | + | |
| 6 | + And 'I should not see "Feature NS-03" in merge requests' do | |
| 7 | + page.should_not have_content "Feature NS-03" | |
| 8 | + end | |
| 9 | + | |
| 10 | + Given 'I click link "Closed"' do | |
| 11 | + click_link "Closed" | |
| 12 | + end | |
| 13 | + | |
| 14 | + Then 'I should see "Feature NS-03" in merge requests' do | |
| 15 | + page.should have_content "Feature NS-03" | |
| 16 | + end | |
| 17 | + | |
| 18 | + And 'I should not see "Bug NS-04" in merge requests' do | |
| 19 | + page.should_not have_content "Bug NS-04" | |
| 20 | + end | |
| 21 | + | |
| 22 | + Given 'I click link "All"' do | |
| 23 | + click_link "All" | |
| 24 | + end | |
| 25 | + | |
| 26 | + Given 'I click link "Bug NS-04"' do | |
| 27 | + click_link "Bug NS-04" | |
| 28 | + end | |
| 29 | + | |
| 30 | + Then 'I should see merge request "Bug NS-04"' do | |
| 31 | + page.should have_content "Bug NS-04" | |
| 32 | + end | |
| 33 | + | |
| 34 | + And 'I click link "Close"' do | |
| 35 | + click_link "Close" | |
| 36 | + end | |
| 37 | + | |
| 38 | + Then 'I should see closed merge request "Bug NS-04"' do | |
| 39 | + mr = MergeRequest.find_by_title("Bug NS-04") | |
| 40 | + mr.closed.should be_true | |
| 41 | + page.should have_content "Closed by" | |
| 42 | + end | |
| 43 | + | |
| 44 | + Given 'I click link "New Merge Request"' do | |
| 45 | + click_link "New Merge Request" | |
| 46 | + end | |
| 47 | + | |
| 48 | + And 'I submit new merge request "Wiki Feature"' do | |
| 49 | + fill_in "merge_request_title", :with => "Wiki Feature" | |
| 50 | + select "master", :from => "merge_request_source_branch" | |
| 51 | + select "stable", :from => "merge_request_target_branch" | |
| 52 | + click_button "Save" | |
| 53 | + end | |
| 54 | + | |
| 55 | + Then 'I should see merge request "Wiki Feature"' do | |
| 56 | + page.should have_content "Wiki Feature" | |
| 57 | + end | |
| 58 | + | |
| 59 | + Given 'I visit merge request page "Bug NS-04"' do | |
| 60 | + mr = MergeRequest.find_by_title("Bug NS-04") | |
| 61 | + visit project_merge_request_path(mr.project, mr) | |
| 62 | + end | |
| 63 | + | |
| 64 | + And 'I leave a comment like "XML attached"' do | |
| 65 | + fill_in "note_note", :with => "XML attached" | |
| 66 | + click_button "Add Comment" | |
| 67 | + end | |
| 68 | + | |
| 69 | + Then 'I should see comment "XML attached"' do | |
| 70 | + page.should have_content "XML attached" | |
| 71 | + end | |
| 72 | + | |
| 73 | + Given 'I sign in as a user' do | |
| 74 | + login_as :user | |
| 75 | + end | |
| 76 | + | |
| 77 | + And 'I own project "Shop"' do | |
| 78 | + @project = Factory :project, :name => "Shop" | |
| 79 | + @project.add_access(@user, :admin) | |
| 80 | + end | |
| 81 | + | |
| 82 | + And 'project "Shop" have "Bug NS-04" open merge request' do | |
| 83 | + project = Project.find_by_name("Shop") | |
| 84 | + Factory.create(:merge_request, | |
| 85 | + :title => "Bug NS-04", | |
| 86 | + :project => project, | |
| 87 | + :author => project.users.first) | |
| 88 | + end | |
| 89 | + | |
| 90 | + And 'project "Shop" have "Feature NS-03" closed merge request' do | |
| 91 | + project = Project.find_by_name("Shop") | |
| 92 | + Factory.create(:merge_request, | |
| 93 | + :title => "Feature NS-03", | |
| 94 | + :project => project, | |
| 95 | + :author => project.users.first, | |
| 96 | + :closed => true) | |
| 97 | + end | |
| 98 | + | |
| 99 | + And 'I visit project "Shop" merge requests page' do | |
| 100 | + visit project_merge_requests_path(Project.find_by_name("Shop")) | |
| 101 | + end | |
| 102 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,28 @@ |
| 1 | +class ProjectNetworkGraph < Spinach::FeatureSteps | |
| 2 | + Then 'page should have network graph' do | |
| 3 | + page.should have_content "Project Network Graph" | |
| 4 | + within ".graph" do | |
| 5 | + page.should have_content "master" | |
| 6 | + page.should have_content "scss_refactor..." | |
| 7 | + end | |
| 8 | + end | |
| 9 | + | |
| 10 | + Given 'I sign in as a user' do | |
| 11 | + login_as :user | |
| 12 | + end | |
| 13 | + | |
| 14 | + And 'I own project "Shop"' do | |
| 15 | + @project = Factory :project, :name => "Shop" | |
| 16 | + @project.add_access(@user, :admin) | |
| 17 | + end | |
| 18 | + | |
| 19 | + And 'I visit project "Shop" network page' do | |
| 20 | + project = Project.find_by_name("Shop") | |
| 21 | + | |
| 22 | + # Stub out find_all to speed this up (10 commits vs. 650) | |
| 23 | + commits = Grit::Commit.find_all(project.repo, nil, {max_count: 10}) | |
| 24 | + Grit::Commit.stub(:find_all).and_return(commits) | |
| 25 | + | |
| 26 | + visit graph_project_path(project) | |
| 27 | + end | |
| 28 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,98 @@ |
| 1 | +class ProjectTeamManagement < Spinach::FeatureSteps | |
| 2 | + Then 'I should be able to see myself in team' do | |
| 3 | + page.should have_content(@user.name) | |
| 4 | + page.should have_content(@user.email) | |
| 5 | + end | |
| 6 | + | |
| 7 | + And 'I should see "Sam" in team list' do | |
| 8 | + user = User.find_by_name("Sam") | |
| 9 | + page.should have_content(user.name) | |
| 10 | + page.should have_content(user.email) | |
| 11 | + end | |
| 12 | + | |
| 13 | + Given 'I click link "New Team Member"' do | |
| 14 | + click_link "New Team Member" | |
| 15 | + end | |
| 16 | + | |
| 17 | + And 'I select "Mike" as "Reporter"' do | |
| 18 | + user = User.find_by_name("Mike") | |
| 19 | + within "#new_team_member" do | |
| 20 | + select user.name, :from => "user_ids" | |
| 21 | + select "Reporter", :from => "project_access" | |
| 22 | + end | |
| 23 | + click_button "Save" | |
| 24 | + end | |
| 25 | + | |
| 26 | + Then 'I should see "Mike" in team list as "Reporter"' do | |
| 27 | + user = User.find_by_name("Mike") | |
| 28 | + role_id = find(".user_#{user.id} #team_member_project_access").value | |
| 29 | + role_id.should == UsersProject.access_roles["Reporter"].to_s | |
| 30 | + end | |
| 31 | + | |
| 32 | + Given 'I should see "Sam" in team list as "Developer"' do | |
| 33 | + user = User.find_by_name("Sam") | |
| 34 | + role_id = find(".user_#{user.id} #team_member_project_access").value | |
| 35 | + role_id.should == UsersProject.access_roles["Developer"].to_s | |
| 36 | + end | |
| 37 | + | |
| 38 | + And 'I change "Sam" role to "Reporter"' do | |
| 39 | + user = User.find_by_name("Sam") | |
| 40 | + within ".user_#{user.id}" do | |
| 41 | + select "Reporter", :from => "team_member_project_access" | |
| 42 | + end | |
| 43 | + end | |
| 44 | + | |
| 45 | + Then 'I visit project "Shop" team page' do | |
| 46 | + visit team_project_path(Project.find_by_name("Shop")) | |
| 47 | + end | |
| 48 | + | |
| 49 | + And 'I should see "Sam" in team list as "Reporter"' do | |
| 50 | + user = User.find_by_name("Sam") | |
| 51 | + role_id = find(".user_#{user.id} #team_member_project_access").value | |
| 52 | + role_id.should == UsersProject.access_roles["Reporter"].to_s | |
| 53 | + end | |
| 54 | + | |
| 55 | + Given 'I click link "Sam"' do | |
| 56 | + click_link "Sam" | |
| 57 | + end | |
| 58 | + | |
| 59 | + Then 'I should see "Sam" team profile' do | |
| 60 | + user = User.find_by_name("Sam") | |
| 61 | + page.should have_content(user.name) | |
| 62 | + page.should have_content(user.email) | |
| 63 | + page.should have_content("To team list") | |
| 64 | + end | |
| 65 | + | |
| 66 | + And 'I click link "Remove from team"' do | |
| 67 | + click_link "Remove from team" | |
| 68 | + end | |
| 69 | + | |
| 70 | + And 'I should not see "Sam" in team list' do | |
| 71 | + user = User.find_by_name("Sam") | |
| 72 | + page.should_not have_content(user.name) | |
| 73 | + page.should_not have_content(user.email) | |
| 74 | + end | |
| 75 | + | |
| 76 | + Given 'I sign in as a user' do | |
| 77 | + login_as :user | |
| 78 | + end | |
| 79 | + | |
| 80 | + And 'I own project "Shop"' do | |
| 81 | + @project = Factory :project, :name => "Shop" | |
| 82 | + @project.add_access(@user, :admin) | |
| 83 | + end | |
| 84 | + | |
| 85 | + And 'gitlab user "Mike"' do | |
| 86 | + Factory :user, :name => "Mike" | |
| 87 | + end | |
| 88 | + | |
| 89 | + And 'gitlab user "Sam"' do | |
| 90 | + Factory :user, :name => "Sam" | |
| 91 | + end | |
| 92 | + | |
| 93 | + And '"Sam" is "Shop" developer' do | |
| 94 | + user = User.find_by_name("Sam") | |
| 95 | + project = Project.find_by_name("Shop") | |
| 96 | + project.add_access(user, :write) | |
| 97 | + end | |
| 98 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,24 @@ |
| 1 | +class ProjectWall < Spinach::FeatureSteps | |
| 2 | + Given 'I write new comment "my special test message"' do | |
| 3 | + fill_in "note_note", :with => "my special test message" | |
| 4 | + click_button "Add Comment" | |
| 5 | + end | |
| 6 | + | |
| 7 | + Then 'I should see project wall note "my special test message"' do | |
| 8 | + page.should have_content "my special test message" | |
| 9 | + end | |
| 10 | + | |
| 11 | + Then 'I visit project "Shop" wall page' do | |
| 12 | + project = Project.find_by_name("Shop") | |
| 13 | + visit wall_project_path(project) | |
| 14 | + end | |
| 15 | + | |
| 16 | + Given 'I signin as a user' do | |
| 17 | + login_as :user | |
| 18 | + end | |
| 19 | + | |
| 20 | + And 'I own project "Shop"' do | |
| 21 | + @project = Factory :project, :name => "Shop" | |
| 22 | + @project.add_access(@user, :admin) | |
| 23 | + end | |
| 24 | +end | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +class ProjectWiki < Spinach::FeatureSteps | |
| 2 | + Given 'I create Wiki page' do | |
| 3 | + fill_in "Title", :with => 'Test title' | |
| 4 | + fill_in "Content", :with => '[link test](test)' | |
| 5 | + click_on "Save" | |
| 6 | + end | |
| 7 | + | |
| 8 | + Then 'I should see newly created wiki page' do | |
| 9 | + page.should have_content "Test title" | |
| 10 | + page.should have_content "link test" | |
| 11 | + | |
| 12 | + click_link "link test" | |
| 13 | + page.should have_content "Editing page" | |
| 14 | + end | |
| 15 | + | |
| 16 | + And 'I leave a comment like "XML attached"' do | |
| 17 | + fill_in "note_note", :with => "XML attached" | |
| 18 | + click_button "Add Comment" | |
| 19 | + end | |
| 20 | + | |
| 21 | + Then 'I should see comment "XML attached"' do | |
| 22 | + page.should have_content "XML attached" | |
| 23 | + end | |
| 24 | + | |
| 25 | + Given 'I sign in as a user' do | |
| 26 | + login_as :user | |
| 27 | + end | |
| 28 | + | |
| 29 | + And 'I own project "Shop"' do | |
| 30 | + @project = Factory :project, :name => "Shop" | |
| 31 | + @project.add_access(@user, :admin) | |
| 32 | + end | |
| 33 | + | |
| 34 | + Given 'I visit project wiki page' do | |
| 35 | + visit project_wiki_path(@project, :index) | |
| 36 | + end | |
| 37 | +end | ... | ... |