diff options
Diffstat (limited to 'features')
55 files changed, 179 insertions, 1350 deletions
diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature deleted file mode 100644 index 1af4d46dec9..00000000000 --- a/features/dashboard/dashboard.feature +++ /dev/null @@ -1,70 +0,0 @@ -@dashboard -Feature: Dashboard - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has push event - And project "Shop" has CI enabled - And project "Shop" has CI build - And project "Shop" has labels: "bug", "feature", "enhancement" - And project "Shop" has issue: "bug report" - And I visit dashboard page - - Scenario: I should see projects list - Then I should see "New Project" link - Then I should see "Shop" project link - Then I should see "Shop" project CI status - - @javascript - Scenario: I should see activity list - And I visit dashboard activity page - Then I should see project "Shop" activity feed - - Scenario: I should see groups list - Given I have group with projects - And I visit dashboard page - Then I should see groups list - - @javascript - Scenario: I should see last push widget - Then I should see last push widget - And I click "Create Merge Request" link - Then I see prefilled new Merge Request page - - @javascript - Scenario: Sorting Issues - Given I visit dashboard issues page - And I sort the list by "Oldest updated" - And I visit dashboard activity page - And I visit dashboard issues page - Then The list should be sorted by "Oldest updated" - - @javascript - Scenario: Filtering Issues by label - Given project "Shop" has issue "Bugfix1" with label "feature" - When I visit dashboard issues page - And I filter the list by label "feature" - Then I should see "Bugfix1" in issues list - - @javascript - Scenario: Visiting Project's issues after sorting - Given I visit dashboard issues page - And I sort the list by "Oldest updated" - And I visit project "Shop" issues page - Then The list should be sorted by "Oldest updated" - - @javascript - Scenario: Sorting Merge Requests - Given I visit dashboard merge requests page - And I sort the list by "Oldest updated" - And I visit dashboard activity page - And I visit dashboard merge requests page - Then The list should be sorted by "Oldest updated" - - @javascript - Scenario: Visiting Project's merge requests after sorting - Given project "Shop" has a "Bugfix MR" merge request open - And I visit dashboard merge requests page - And I sort the list by "Oldest updated" - And I visit project "Shop" merge requests page - Then The list should be sorted by "Oldest updated" diff --git a/features/dashboard/event_filters.feature b/features/dashboard/event_filters.feature deleted file mode 100644 index 8c3ff64164f..00000000000 --- a/features/dashboard/event_filters.feature +++ /dev/null @@ -1,58 +0,0 @@ -@dashboard -Feature: Event Filters - Background: - Given I sign in as a user - And I own a project - And this project has push event - And this project has new member event - And this project has merge request event - And I visit dashboard activity page - - @javascript - Scenario: I should see all events - Then I should see push event - And I should see new member event - And I should see merge request event - - @javascript - Scenario: I should see only pushed events - When I click "push" event filter - Then I should see push event - And I should not see new member event - And I should not see merge request event - - @javascript - Scenario: I should see only joined events - When I click "team" event filter - Then I should see new member event - And I should not see push event - And I should not see merge request event - - @javascript - Scenario: I should see only merged events - When I click "merge" event filter - Then I should see merge request event - And I should not see push event - And I should not see new member event - - @javascript - Scenario: I should see only selected events while page reloaded - When I click "push" event filter - And I visit dashboard activity page - Then I should see push event - And I should not see new member event - When I click "team" event filter - And I visit dashboard activity page - Then I should not see push event - And I should see new member event - And I should not see merge request event - When I click "push" event filter - And I visit dashboard activity page - Then I should see push event - And I should not see new member event - And I should not see merge request event - When I click "merge" event filter - And I visit dashboard activity page - Then I should see merge request event - And I should not see push event - And I should not see new member event diff --git a/features/dashboard/merge_requests.feature b/features/dashboard/merge_requests.feature deleted file mode 100644 index 4a2c997d707..00000000000 --- a/features/dashboard/merge_requests.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Merge Requests - Background: - Given I sign in as a user - And I have authored merge requests - And I have assigned merge requests - And I have other merge requests - And I visit dashboard merge requests page - - Scenario: I should see assigned merge_requests - Then I should see merge requests assigned to me - - @javascript - Scenario: I should see authored merge_requests - When I click "Authored by me" link - Then I should see merge requests authored by me - - @javascript - Scenario: I should see all merge_requests - When I click "All" link - Then I should see all merge requests diff --git a/features/dashboard/new_project.feature b/features/dashboard/new_project.feature deleted file mode 100644 index 046e2815d4e..00000000000 --- a/features/dashboard/new_project.feature +++ /dev/null @@ -1,30 +0,0 @@ -@dashboard -Feature: New Project -Background: - Given I sign in as a user - And I own project "Shop" - And I visit dashboard page - And I click "New project" link - - @javascript - Scenario: I should see New Projects page - Then I see "New Project" page - Then I see all possible import options - - @javascript - Scenario: I should see instructions on how to import from Git URL - Given I see "New Project" page - When I click on "Repo by URL" - Then I see instructions on how to import from Git URL - - @javascript - Scenario: I should see instructions on how to import from GitHub - Given I see "New Project" page - When I click on "Import project from GitHub" - Then I am redirected to the GitHub import page - - @javascript - Scenario: I should see Google Code import page - Given I see "New Project" page - When I click on "Google Code" - Then I redirected to Google Code import page diff --git a/features/dashboard/todos.feature b/features/dashboard/todos.feature deleted file mode 100644 index 0b23bbb7951..00000000000 --- a/features/dashboard/todos.feature +++ /dev/null @@ -1,28 +0,0 @@ -@dashboard -Feature: Dashboard Todos - Background: - Given I sign in as a user - And I own project "Shop" - And "John Doe" is a developer of project "Shop" - And "Mary Jane" is a developer of project "Shop" - And "Mary Jane" owns private project "Enterprise" - And I am a developer of project "Enterprise" - And I have todos - And I visit dashboard todos page - - @javascript - Scenario: I mark todos as done - Then I should see todos assigned to me - And I mark the todo as done - Then I should see the todo marked as done - - @javascript - Scenario: I mark all todos as done - Then I should see todos assigned to me - And I mark all todos as done - Then I should see all todos marked as done - - @javascript - Scenario: I click on a todo row - Given I click on the todo - Then I should be directed to the corresponding page diff --git a/features/group/members.feature b/features/group/members.feature index e539f6a1273..49a44f57cbb 100644 --- a/features/group/members.feature +++ b/features/group/members.feature @@ -4,65 +4,6 @@ Feature: Group Members And "John Doe" is owner of group "Owned" And "John Doe" is guest of group "Guest" - # Leave - - @javascript - Scenario: Owner should be able to remove himself from group if he is not the last owner - Given "Mary Jane" is owner of group "Owned" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - When I click on the "Remove User From Group" button for "John Doe" - And I visit group "Owned" members page - Then I should not see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - - @javascript - Scenario: Owner should not be able to remove himself from group if he is the last owner - Given "Mary Jane" is guest of group "Owned" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - Then I should not see the "Remove User From Group" button for "John Doe" - - @javascript - Scenario: Guest should be able to remove himself from group - Given "Mary Jane" is guest of group "Guest" - When I visit group "Guest" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - When I click on the "Remove User From Group" button for "John Doe" - When I visit group "Guest" members page - Then I should not see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - - @javascript - Scenario: Guest should be able to remove himself from group even if he is the only user in the group - When I visit group "Guest" members page - Then I should see user "John Doe" in team list - When I click on the "Remove User From Group" button for "John Doe" - When I visit group "Guest" members page - Then I should not see user "John Doe" in team list - - # Remove others - - Scenario: Owner should be able to remove other users from group - Given "Mary Jane" is owner of group "Owned" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - When I click on the "Remove User From Group" button for "Mary Jane" - When I visit group "Owned" members page - Then I should see user "John Doe" in team list - Then I should not see user "Mary Jane" in team list - - Scenario: Guest should not be able to remove other users from group - Given "Mary Jane" is guest of group "Guest" - When I visit group "Guest" members page - Then I should see user "John Doe" in team list - Then I should see user "Mary Jane" in team list - Then I should not see the "Remove User From Group" button for "Mary Jane" - Scenario: Search member by name Given "Mary Jane" is guest of group "Guest" And I visit group "Guest" members page diff --git a/features/group/milestones.feature b/features/group/milestones.feature index 1c1539b3e12..2211acfee20 100644 --- a/features/group/milestones.feature +++ b/features/group/milestones.feature @@ -22,12 +22,12 @@ Feature: Group Milestones Then I should see group milestone with descriptions and expiry date And I should see group milestone with all issues and MRs assigned to that milestone - Scenario: Create multiple milestones with one form + Scenario: Create group milestones Given I visit group "Owned" milestones page And I click new milestone button And I fill milestone name When I press create mileston button - Then milestone in each project should be created + Then group milestone should be created Scenario: I should see Issues listed with labels Given Group has projects with milestones diff --git a/features/profile/notifications.feature b/features/profile/notifications.feature deleted file mode 100644 index ef8743932f5..00000000000 --- a/features/profile/notifications.feature +++ /dev/null @@ -1,15 +0,0 @@ -@profile -Feature: Profile Notifications - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I visit notifications tab - When I visit profile notifications page - Then I should see global notifications settings - - @javascript - Scenario: I edit Project Notifications - Given I visit profile notifications page - When I select Mention setting from dropdown - Then I should see Notification saved message diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature index 34201cd8486..3ea0aab5a67 100644 --- a/features/project/active_tab.feature +++ b/features/project/active_tab.feature @@ -31,6 +31,11 @@ Feature: Project Active Tab Then the active main tab should be Wiki And no other main tabs should be active + Scenario: On Project Members + Given I visit my project's members page + Then the active main tab should be Members + And no other main tabs should be active + # Sub Tabs: Home Scenario: On Project Home/Show @@ -63,12 +68,6 @@ Feature: Project Active Tab And no other sub tabs should be active And the active main tab should be Settings - Scenario: On Project Members - Given I visit my project's members page - Then the active sub tab should be Members - And no other sub tabs should be active - And the active main tab should be Settings - # Sub Tabs: Repository Scenario: On Project Repository/Files diff --git a/features/project/badges/build.feature b/features/project/badges/build.feature deleted file mode 100644 index bcf80ed620e..00000000000 --- a/features/project/badges/build.feature +++ /dev/null @@ -1,27 +0,0 @@ -Feature: Project Badges Build - Background: - Given I sign in as a user - And I own a project - And project has CI enabled - And project has a recent build - - Scenario: I want to see a badge for successfully built project - Given recent build is successful - When I display builds badge for a master branch - Then I should see a build success badge - - Scenario: I want to see a badge for project with failed builds - Given recent build failed - When I display builds badge for a master branch - Then I should see a build failed badge - - Scenario: I want to see a badge for project with running builds - Given recent build is successful - And project has another build that is running - When I display builds badge for a master branch - Then I should see a build running badge - - Scenario: I want to see a fresh badge on each request - Given recent build is successful - When I display builds badge for a master branch - Then I should see a badge that has not been cached diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature deleted file mode 100644 index 472ec9544f3..00000000000 --- a/features/project/source/browse_files.feature +++ /dev/null @@ -1,333 +0,0 @@ -Feature: Project Source Browse Files - Background: - Given I sign in as a user - And I own project "Shop" - Given I visit project source page - - Scenario: I browse files from master branch - Then I should see files from repository - - Scenario: I browse files for specific ref - Given I visit project source page for "6d39438" - Then I should see files from repository for "6d39438" - - @javascript - Scenario: I browse file content - Given I click on ".gitignore" file in repo - Then I should see its content - - Scenario: I browse raw file - Given I visit blob file from repo - And I click link "Raw" - Then I should see raw file content - - Scenario: I can create file - Given I click on "New file" link in repo - Then I can see new file page - - Scenario: I can create file when I don't have write access - Given I don't have write access - And I click on "New file" link in repo - Then I should see a notice about a new fork having been created - Then I can see new file page - - @javascript - Scenario: I can create and commit file - Given I click on "New file" link in repo - And I edit code - And I fill the new file name - And I fill the commit message - And I click on "Commit changes" - Then I am redirected to the new file - And I should see its new content - - @javascript - Scenario: I can create and commit file when I don't have write access - Given I don't have write access - And I click on "New file" link in repo - And I edit code - And I fill the new file name - And I fill the commit message - And I click on "Commit changes" - Then I am redirected to the fork's new merge request page - And I can see the new commit message - - @javascript - Scenario: I can create and commit file with new lines at the end of file - Given I click on "New file" link in repo - And I edit code with new lines at end of file - And I fill the new file name - And I fill the commit message - And I click on "Commit changes" - Then I am redirected to the new file - And I click button "Edit" - And I should see its content with new lines preserved at end of file - - @javascript - Scenario: I can create and commit file and specify new branch - Given I click on "New file" link in repo - And I edit code - And I fill the new file name - And I fill the commit message - And I fill the new branch name - And I click on "Commit changes" - Then I am redirected to the new merge request page - When I click on "Changes" tab - And I should see its new content - - @javascript - Scenario: I can upload file and commit - Given I click on "Upload file" link in repo - And I upload a new text file - And I fill the upload file commit message - And I fill the new branch name - And I click on "Upload file" - Then I can see the new commit message - And I am redirected to the new merge request page - When I click on "Changes" tab - Then I can see the new text file - - @javascript - Scenario: I can upload file and commit when I don't have write access - Given I don't have write access - And I click on "Upload file" link in repo - Then I should see a notice about a new fork having been created - When I click on "Upload file" link in repo - And I upload a new text file - And I fill the upload file commit message - And I click on "Upload file" - Then I can see the new commit message - And I am redirected to the fork's new merge request page - When I click on "Changes" tab - Then I can see the new text file - - @javascript - Scenario: I can replace file and commit - Given I click on ".gitignore" file in repo - And I see the ".gitignore" - And I click on "Replace" - And I replace it with a text file - And I fill the replace file commit message - And I click on "Replace file" - Then I can see the new text file - And I can see the replacement commit message - - @javascript - Scenario: I can replace file and commit when I don't have write access - Given I don't have write access - And I click on ".gitignore" file in repo - And I see the ".gitignore" - And I click on "Replace" - Then I should see a Fork/Cancel combo - And I click button "Fork" - Then I should see a notice about a new fork having been created - When I click on "Replace" - And I replace it with a text file - And I fill the replace file commit message - And I click on "Replace file" - And I can see the replacement commit message - And I am redirected to the fork's new merge request page - When I click on "Changes" tab - Then I can see the new text file - - @javascript - Scenario: If I enter an illegal file name I see an error message - Given I click on "New file" link in repo - And I fill the new file name with an illegal name - And I edit code - And I fill the commit message - And I click on "Commit changes" - Then I am on the new file page - And I see "Path can contain only..." - - @javascript - Scenario: I can create file with a directory name - Given I click on "New file" link in repo - And I fill the new file name with a new directory - And I edit code - And I fill the commit message - And I click on "Commit changes" - Then I am redirected to the new file with directory - And I should see its new content - - @javascript - Scenario: I can edit file - Given I click on ".gitignore" file in repo - And I click button "Edit" - Then I can edit code - - @javascript - Scenario: I can edit file when I don't have write access - Given I don't have write access - And I click on ".gitignore" file in repo - And I click button "Edit" - Then I should see a Fork/Cancel combo - And I click button "Fork" - Then I should see a notice about a new fork having been created - And I can edit code - - Scenario: If the file is binary the edit link is hidden - Given I visit a binary file in the repo - Then I cannot see the edit button - - @javascript - Scenario: I can edit and commit file - Given I click on ".gitignore" file in repo - And I click button "Edit" - And I edit code - And I fill the commit message - And I click on "Commit changes" - Then I am redirected to the ".gitignore" - And I should see its new content - - @javascript - Scenario: I can edit and commit file when I don't have write access - Given I don't have write access - And I click on ".gitignore" file in repo - And I click button "Edit" - Then I should see a Fork/Cancel combo - And I click button "Fork" - And I edit code - And I fill the commit message - And I click on "Commit changes" - Then I am redirected to the fork's new merge request page - And I can see the new commit message - - @javascript - Scenario: I can edit and commit file to new branch - Given I click on ".gitignore" file in repo - And I click button "Edit" - And I edit code - And I fill the commit message - And I fill the new branch name - And I click on "Commit changes" - Then I am redirected to the new merge request page - Then I click on "Changes" tab - And I should see its new content - - @javascript @wip - Scenario: If I don't change the content of the file I see an error message - Given I click on ".gitignore" file in repo - And I click button "edit" - And I fill the commit message - And I click on "Commit changes" - # Test fails because carriage returns are added to the file. - Then I am on the ".gitignore" edit file page - And I see a commit error message - - @javascript - Scenario: I can create directory in repo - When I click on "New directory" link in repo - And I fill the new directory name - And I fill the commit message - And I fill the new branch name - And I click on "Create directory" - Then I am redirected to the new merge request page - - @javascript - Scenario: I can create directory in repo when I don't have write access - Given I don't have write access - When I click on "New directory" link in repo - Then I should see a notice about a new fork having been created - When I click on "New directory" link in repo - And I fill the new directory name - And I fill the commit message - And I click on "Create directory" - Then I am redirected to the fork's new merge request page - - @javascript - Scenario: I attempt to create an existing directory - When I click on "New directory" link in repo - And I fill an existing directory name - And I fill the commit message - And I click on "Create directory" - Then I see "Unable to create directory" - And I am redirected to the root directory - - @javascript - Scenario: I can see editing preview - Given I click on ".gitignore" file in repo - And I click button "Edit" - And I edit code - And I click link "Diff" - Then I see diff - - @javascript - Scenario: I can delete file and commit - Given I click on ".gitignore" file in repo - And I see the ".gitignore" - And I click on "Delete" - And I fill the commit message - And I click on "Delete file" - Then I am redirected to the files URL - And I don't see the ".gitignore" - - @javascript - Scenario: I can delete file and commit when I don't have write access - Given I don't have write access - And I click on ".gitignore" file in repo - And I see the ".gitignore" - And I click on "Delete" - Then I should see a Fork/Cancel combo - And I click button "Fork" - Then I should see a notice about a new fork having been created - When I click on "Delete" - And I fill the commit message - And I click on "Delete file" - Then I am redirected to the fork's new merge request page - And I can see the new commit message - - Scenario: I can browse directory with Browse Dir - Given I click on files directory - And I click on History link - Then I see Browse dir link - - Scenario: I can browse file with Browse File - Given I click on readme file - And I click on History link - Then I see Browse file link - - Scenario: I can browse code with Browse Code - Given I click on History link - Then I see Browse code link - - # Permalink - - Scenario: I click on the permalink link from a branch ref - Given I click on ".gitignore" file in repo - And I click on Permalink - Then I am redirected to the permalink URL - - Scenario: I don't see the permalink link from a SHA ref - Given I visit project source page for "6d394385cf567f80a8fd85055db1ab4c5295806f" - And I click on ".gitignore" file in repo - Then I don't see the permalink link - - @javascript - Scenario: I browse code with single quotes in the ref - Given I switch ref to 'test' - And I see the ref 'test' has been selected - And I visit the 'test' tree - Then I see the commit data - - @javascript - Scenario: I browse code with a leading dot in the directory - Given I switch ref to fix - And I visit the fix tree - Then I see the commit data for a directory with a leading dot - - Scenario: I browse LFS object - Given I click on "files/lfs/lfs_object.iso" file in repo - Then I should see download link and object size - And I should not see lfs pointer details - And I should see buttons for allowed commands - - @javascript - Scenario: I preview an SVG file - Given I click on "Upload file" link in repo - And I upload a new SVG file - And I fill the upload file commit message - And I fill the new branch name - And I click on "Upload file" - Given I visit the SVG file - Then I can see the new rendered SVG image diff --git a/features/snippets/snippets.feature b/features/snippets/snippets.feature deleted file mode 100644 index 1ad02780229..00000000000 --- a/features/snippets/snippets.feature +++ /dev/null @@ -1,40 +0,0 @@ -@snippets -Feature: Snippets - Background: - Given I sign in as a user - And I have public "Personal snippet one" snippet - And I have private "Personal snippet private" snippet - - @javascript - Scenario: I create new snippet - Given I visit new snippet page - And I submit new snippet "Personal snippet three" - Then I should see snippet "Personal snippet three" - - Scenario: I update "Personal snippet one" - Given I visit snippet page "Personal snippet one" - And I click link "Edit" - And I submit new title "Personal snippet new title" - Then I should see "Personal snippet new title" - - Scenario: Set "Personal snippet one" public - Given I visit snippet page "Personal snippet one" - And I click link "Edit" - And I uncheck "Private" checkbox - Then I should see "Personal snippet one" public - - Scenario: I destroy "Personal snippet one" - Given I visit snippet page "Personal snippet one" - And I click link "Delete" - Then I should not see "Personal snippet one" in snippets - - Scenario: I create new internal snippet - Given I logout directly - And I sign in as an admin - Then I visit new snippet page - And I submit new internal snippet - Then I visit snippet page "Internal personal snippet one" - And I logout directly - Then I sign in as a user - Given I visit new snippet page - Then I visit snippet page "Internal personal snippet one" diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb deleted file mode 100644 index a745254cc31..00000000000 --- a/features/steps/dashboard/event_filters.rb +++ /dev/null @@ -1,92 +0,0 @@ -class Spinach::Features::EventFilters < Spinach::FeatureSteps - include WaitForRequests - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see push event' do - expect(page).to have_selector('span.pushed') - end - - step 'I should not see push event' do - expect(page).not_to have_selector('span.pushed') - end - - step 'I should see new member event' do - expect(page).to have_selector('span.joined') - end - - step 'I should not see new member event' do - expect(page).not_to have_selector('span.joined') - end - - step 'I should see merge request event' do - expect(page).to have_selector('span.accepted') - end - - step 'I should not see merge request event' do - expect(page).not_to have_selector('span.accepted') - end - - step 'this project has push event' do - data = { - before: Gitlab::Git::BLANK_SHA, - after: "0220c11b9a3e6c69dc8fd35321254ca9a7b98f7e", - ref: "refs/heads/new_design", - user_id: @user.id, - user_name: @user.name, - repository: { - name: @project.name, - url: "localhost/rubinius", - description: "", - homepage: "localhost/rubinius", - private: true - } - } - - @event = Event.create( - project: @project, - action: Event::PUSHED, - data: data, - author_id: @user.id - ) - end - - step 'this project has new member event' do - user = create(:user, { name: "John Doe" }) - Event.create( - project: @project, - author_id: user.id, - action: Event::JOINED - ) - end - - 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, - action: Event::MERGED, - target_id: merge_request.id, - target_type: "MergeRequest", - author_id: @user.id - ) - end - - When 'I click "push" event filter' do - wait_for_requests - click_link("Push events") - wait_for_requests - end - - When 'I click "team" event filter' do - wait_for_requests - click_link("Team") - wait_for_requests - end - - When 'I click "merge" event filter' do - wait_for_requests - click_link("Merge events") - wait_for_requests - end -end diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb deleted file mode 100644 index 909ffec3646..00000000000 --- a/features/steps/dashboard/merge_requests.rb +++ /dev/null @@ -1,121 +0,0 @@ -class Spinach::Features::DashboardMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see merge requests assigned to me' do - should_see(assigned_merge_request) - should_see(assigned_merge_request_from_fork) - should_not_see(authored_merge_request) - should_not_see(authored_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see merge requests authored by me' do - should_see(authored_merge_request) - should_see(authored_merge_request_from_fork) - should_not_see(assigned_merge_request) - should_not_see(assigned_merge_request_from_fork) - should_not_see(other_merge_request) - end - - step 'I should see all merge requests' do - should_see(authored_merge_request) - should_see(assigned_merge_request) - should_see(other_merge_request) - end - - step 'I have authored merge requests' do - authored_merge_request - authored_merge_request_from_fork - end - - step 'I have assigned merge requests' do - assigned_merge_request - assigned_merge_request_from_fork - end - - step 'I have other merge requests' do - other_merge_request - end - - step 'I click "Authored by me" link' do - find("#assignee_id").set("") - find(".js-author-search", match: :first).click - find(".dropdown-menu-author li a", match: :first, text: current_user.to_reference).click - end - - step 'I click "All" link' do - find(".js-author-search").click - expect(page).to have_selector(".dropdown-menu-author li a") - find(".dropdown-menu-author li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-author li a") - - find(".js-assignee-search").click - expect(page).to have_selector(".dropdown-menu-assignee li a") - find(".dropdown-menu-assignee li a", match: :first).click - expect(page).not_to have_selector(".dropdown-menu-assignee li a") - end - - def should_see(merge_request) - expect(page).to have_content(merge_request.title[0..10]) - end - - def should_not_see(merge_request) - expect(page).not_to have_content(merge_request.title[0..10]) - end - - def assigned_merge_request - @assigned_merge_request ||= create :merge_request, - assignee: current_user, - target_project: project, - source_project: project - end - - def authored_merge_request - @authored_merge_request ||= create :merge_request, - source_branch: 'markdown', - author: current_user, - target_project: project, - source_project: project - end - - def other_merge_request - @other_merge_request ||= create :merge_request, - source_branch: 'fix', - target_project: project, - source_project: project - end - - def authored_merge_request_from_fork - @authored_merge_request_from_fork ||= create :merge_request, - source_branch: 'feature_conflict', - author: current_user, - target_project: public_project, - source_project: forked_project - end - - def assigned_merge_request_from_fork - @assigned_merge_request_from_fork ||= create :merge_request, - source_branch: 'markdown', - assignee: current_user, - target_project: public_project, - source_project: forked_project - end - - def project - @project ||= begin - project = create(:project, :repository) - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create(:project, :public, :repository) - end - - def forked_project - @forked_project ||= Projects::ForkService.new(public_project, current_user).execute - end -end diff --git a/features/steps/dashboard/new_project.rb b/features/steps/dashboard/new_project.rb deleted file mode 100644 index 530fd6f7bdb..00000000000 --- a/features/steps/dashboard/new_project.rb +++ /dev/null @@ -1,59 +0,0 @@ -class Spinach::Features::NewProject < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click "New project" link' do - page.within '#content-body' do - click_link "New project" - end - end - - step 'I click "New project" in top right menu' do - page.within '.header-content' do - click_link "New project" - end - end - - step 'I see "New Project" page' do - expect(page).to have_content('Project path') - expect(page).to have_content('Project name') - end - - step 'I see all possible import options' do - expect(page).to have_link('GitHub') - expect(page).to have_link('Bitbucket') - expect(page).to have_link('GitLab.com') - expect(page).to have_link('Google Code') - expect(page).to have_button('Repo by URL') - expect(page).to have_link('GitLab export') - end - - step 'I click on "Import project from GitHub"' do - first('.import_github').click - end - - step 'I am redirected to the GitHub import page' do - expect(page).to have_content('Import Projects from GitHub') - expect(current_path).to eq new_import_github_path - end - - step 'I click on "Repo by URL"' do - first('.import_git').click - end - - step 'I see instructions on how to import from Git URL' do - git_import_instructions = first('.js-toggle-content') - expect(git_import_instructions).to be_visible - expect(git_import_instructions).to have_content "Git repository URL" - end - - step 'I click on "Google Code"' do - first('.import_google_code').click - end - - step 'I redirected to Google Code import page' do - expect(page).to have_content('Import projects from Google Code') - expect(current_path).to eq new_import_google_code_path - end -end diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb deleted file mode 100644 index c33813e550b..00000000000 --- a/features/steps/dashboard/starred_projects.rb +++ /dev/null @@ -1,15 +0,0 @@ -class Spinach::Features::DashboardStarredProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I starred project "Community"' do - current_user.toggle_star(Project.find_by(name: 'Community')) - end - - step 'I should not see project "Shop"' do - page.within '.projects-list' do - expect(page).not_to have_content('Shop') - end - end -end diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb index 1a55f40abb9..f1288c15084 100644 --- a/features/steps/explore/projects.rb +++ b/features/steps/explore/projects.rb @@ -66,7 +66,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps title: "New feature", project: public_project ) - visit namespace_project_issues_path(public_project.namespace, public_project) + visit project_issues_path(public_project) end step 'I should see list of issues for "Community" project' do @@ -84,7 +84,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps title: "New internal feature", project: internal_project ) - visit namespace_project_issues_path(internal_project.namespace, internal_project) + visit project_issues_path(internal_project) end step 'I should see list of issues for "Internal" project' do @@ -94,7 +94,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps end step 'I visit "Community" merge requests page' do - visit namespace_project_merge_requests_path(public_project.namespace, public_project) + visit project_merge_requests_path(public_project) end step 'project "Community" has "Bug fix" open merge request' do @@ -111,7 +111,7 @@ class Spinach::Features::ExploreProjects < Spinach::FeatureSteps end step 'I visit "Internal" merge requests page' do - visit namespace_project_merge_requests_path(internal_project.namespace, internal_project) + visit project_merge_requests_path(internal_project) end step 'project "Internal" has "Feature implemented" open merge request' do diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb index 0542b06c0ab..915d766dd60 100644 --- a/features/steps/group/milestones.rb +++ b/features/steps/group/milestones.rb @@ -39,7 +39,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps expect(page).to have_content('Milestone GL-113') expect(page).to have_content('Issues 3 Open: 3 Closed: 0') issue = Milestone.find_by(name: 'GL-113').issues.first - expect(page).to have_link(issue.title, href: namespace_project_issue_path(issue.project.namespace, issue.project, issue)) + expect(page).to have_link(issue.title, href: project_issue_path(issue.project, issue)) end step 'I fill milestone name' do @@ -54,14 +54,9 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps click_button "Create milestone" end - step 'milestone in each project should be created' do + step 'group milestone should be created' do group = Group.find_by(name: 'Owned') - expect(page).to have_content "Milestone v2.9.0" - expect(group.projects).to be_present - - group.projects.each do |project| - expect(page).to have_content project.name - end + expect(page).to have_content group.milestones.find_by_title('v2.9.0').title end step 'I should see the "bug" label' do diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 25bb374b868..6b288b47da4 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -5,7 +5,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps include SharedUser step 'I should see group "Owned"' do - expect(page).to have_content '@owned' + expect(page).to have_content 'Owned' end step 'I am a signed out user' do @@ -81,7 +81,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps step 'I should see new group "Owned" avatar' do expect(owned_group.avatar).to be_instance_of AvatarUploader - expect(owned_group.avatar.url).to eq "/uploads/system/group/avatar/#{Group.find_by(name: "Owned").id}/banana_sample.gif" + expect(owned_group.avatar.url).to eq "/uploads/-/system/group/avatar/#{Group.find_by(name: "Owned").id}/banana_sample.gif" end step 'I should see the "Remove avatar" button' do diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 254c26bb6af..4b88cb5e27f 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -36,7 +36,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps step 'I should see new avatar' do expect(@user.avatar).to be_instance_of AvatarUploader - expect(@user.avatar.url).to eq "/uploads/system/user/avatar/#{@user.id}/banana_sample.gif" + expect(@user.avatar.url).to eq "/uploads/-/system/user/avatar/#{@user.id}/banana_sample.gif" end step 'I should see the "Remove avatar" button' do diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb index b6f1d417e21..e4847180be9 100644 --- a/features/steps/project/archived.rb +++ b/features/steps/project/archived.rb @@ -15,7 +15,7 @@ class Spinach::Features::ProjectArchived < Spinach::FeatureSteps When 'I visit project "Forum" page' do project = Project.find_by(name: "Forum") - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I should not see "Archived"' do diff --git a/features/steps/project/badges/build.rb b/features/steps/project/badges/build.rb deleted file mode 100644 index 96c59322f9b..00000000000 --- a/features/steps/project/badges/build.rb +++ /dev/null @@ -1,32 +0,0 @@ -class Spinach::Features::ProjectBadgesBuild < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedBuilds - include RepoHelpers - - step 'I display builds badge for a master branch' do - visit build_namespace_project_badges_path(@project.namespace, @project, ref: :master, format: :svg) - end - - step 'I should see a build success badge' do - expect_badge('success') - end - - step 'I should see a build failed badge' do - expect_badge('failed') - end - - step 'I should see a build running badge' do - expect_badge('running') - end - - step 'I should see a badge that has not been cached' do - expect(page.response_headers['Cache-Control']).to include 'no-cache' - end - - def expect_badge(status) - svg = Nokogiri::XML.parse(page.body) - expect(page.response_headers['Content-Type']).to include('image/svg+xml') - expect(svg.at(%Q{text:contains("#{status}")})).to be_truthy - end -end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb index f19fa1c7600..305fff37c41 100644 --- a/features/steps/project/commits/commits.rb +++ b/features/steps/project/commits/commits.rb @@ -33,7 +33,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I see commit info' do @@ -73,7 +73,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I visit commits list page for feature branch' do - visit namespace_project_commits_path(@project.namespace, @project, 'feature', { limit: 5 }) + visit project_commits_path(@project, 'feature', { limit: 5 }) end step 'I see feature branch commits' do @@ -119,7 +119,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps step 'I should see button to the merge request' do merge_request = MergeRequest.find_by(title: 'Feature') - expect(page).to have_link "View open merge request", href: namespace_project_merge_request_path(@project.namespace, @project, merge_request) + expect(page).to have_link "View open merge request", href: project_merge_request_path(@project, merge_request) end step 'I see breadcrumb links' do @@ -135,7 +135,7 @@ class Spinach::Features::ProjectCommits < Spinach::FeatureSteps end step 'I visit a commit with an image that changed' do - visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) + visit project_commit_path(@project, sample_image_commit.id) end step 'The diff links to both the previous and current image' do diff --git a/features/steps/project/commits/revert.rb b/features/steps/project/commits/revert.rb index 114de129d19..ebfa7a878bb 100644 --- a/features/steps/project/commits/revert.rb +++ b/features/steps/project/commits/revert.rb @@ -6,7 +6,7 @@ class Spinach::Features::RevertCommits < Spinach::FeatureSteps include RepoHelpers step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I click on the revert button' do diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb index 2d43be5a386..4599e0d032a 100644 --- a/features/steps/project/commits/user_lookup.rb +++ b/features/steps/project/commits/user_lookup.rb @@ -4,11 +4,11 @@ class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps include SharedPaths step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I click on another commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.parent_id) + visit project_commit_path(@project, sample_commit.parent_id) end step 'I have user with primary email' do diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb index 28be9c6df5b..60fa232672e 100644 --- a/features/steps/project/create.rb +++ b/features/steps/project/create.rb @@ -7,12 +7,12 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps fill_in 'project_path', with: 'Empty' page.within '#content-body' do click_button "Create project" - end + end end step 'I should see project page' do expect(page).to have_content "Empty" - expect(current_path).to eq namespace_project_path(Project.last.namespace, Project.last) + expect(current_path).to eq project_path(Project.last) end step 'I should see empty project instructions' do diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb index 8ad9d4a4741..b58d595c7c6 100644 --- a/features/steps/project/deploy_keys.rb +++ b/features/steps/project/deploy_keys.rb @@ -36,7 +36,7 @@ class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps end step 'I should be on deploy keys page' do - expect(current_path).to eq namespace_project_settings_repository_path(@project.namespace, @project) + expect(current_path).to eq project_settings_repository_path(@project) end step 'I should see newly created deploy key' do diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb index 35df403a85f..dd4dff7f7a9 100644 --- a/features/steps/project/fork.rb +++ b/features/steps/project/fork.rb @@ -53,7 +53,7 @@ class Spinach::Features::ProjectFork < Spinach::FeatureSteps step 'I visit the forks page of the "Shop" project' do @project = Project.where(name: 'Shop').last - visit namespace_project_forks_path(@project.namespace, @project) + visit project_forks_path(@project) end step 'I should see my fork on the list' do diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb index 2d9d3efd9d4..c6cabace25b 100644 --- a/features/steps/project/forked_merge_requests.rb +++ b/features/steps/project/forked_merge_requests.rb @@ -25,7 +25,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps step 'I should see merge request "Merge Request On Forked Project"' do expect(@project.merge_requests.size).to be >= 1 @merge_request = @project.merge_requests.last - expect(current_path).to eq namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(current_path).to eq project_merge_request_path(@project, @merge_request) expect(@merge_request.title).to eq "Merge Request On Forked Project" expect(@merge_request.source_project).to eq @forked_project expect(@merge_request.source_branch).to eq "fix" @@ -77,7 +77,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps expect(page).to have_content "An Edited Forked Merge Request" expect(@project.merge_requests.size).to be >= 1 @merge_request = @project.merge_requests.last - expect(current_path).to eq namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(current_path).to eq project_merge_request_path(@project, @merge_request) expect(@merge_request.source_project).to eq @forked_project expect(@merge_request.source_branch).to eq "fix" expect(@merge_request.target_branch).to eq "master" @@ -97,7 +97,7 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps end step 'I see the edit page prefilled for "Merge Request On Forked Project"' do - expect(current_path).to eq edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) + expect(current_path).to eq edit_project_merge_request_path(@project, @merge_request) expect(page).to have_content "Edit merge request #{@merge_request.to_reference}" expect(find("#merge_request_title").value).to eq "Merge Request On Forked Project" end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb index 176d04d721c..e78e25318a6 100644 --- a/features/steps/project/graph.rb +++ b/features/steps/project/graph.rb @@ -7,19 +7,19 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps end When 'I visit project "Shop" graph page' do - visit namespace_project_graph_path(project.namespace, project, "master") + visit project_graph_path(project, "master") end step 'I visit project "Shop" commits graph page' do - visit commits_namespace_project_graph_path(project.namespace, project, "master") + visit commits_project_graph_path(project, "master") end step 'I visit project "Shop" languages graph page' do - visit languages_namespace_project_graph_path(project.namespace, project, "master") + visit languages_project_graph_path(project, "master") end step 'I visit project "Shop" chart page' do - visit charts_namespace_project_graph_path(project.namespace, project, "master") + visit charts_project_graph_path(project, "master") end step 'page should have languages graphs' do @@ -33,7 +33,7 @@ class Spinach::Features::ProjectGraph < Spinach::FeatureSteps end step 'I visit project "Shop" CI graph page' do - visit ci_namespace_project_graph_path(project.namespace, project, 'master') + visit ci_project_graph_path(project, 'master') end step 'page should have CI graphs' do diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb index 2324edda975..bbd284b4633 100644 --- a/features/steps/project/issues/award_emoji.rb +++ b/features/steps/project/issues/award_emoji.rb @@ -5,7 +5,7 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps include Select2Helper step 'I visit "Bugfix" issue page' do - visit namespace_project_issue_path(@project.namespace, @project, @issue) + visit project_issue_path(@project, @issue) end step 'I click the thumbsup award Emoji' do diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb index e4a559d8ff5..2deef9036d3 100644 --- a/features/steps/project/issues/issues.rb +++ b/features/steps/project/issues/issues.rb @@ -247,7 +247,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps When 'I visit empty project page' do project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I see empty project details with ssh clone info' do @@ -259,12 +259,12 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps When "I visit project \"Community\" issues page" do project = Project.find_by(name: 'Community') - visit namespace_project_issues_path(project.namespace, project) + visit project_issues_path(project) end When "I visit empty project's issues page" do project = Project.find_by(name: 'Empty Project') - visit namespace_project_issues_path(project.namespace, project) + visit project_issues_path(project) end step 'I leave a comment with code block' do diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index 2828e41f731..dac18c537ac 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps include SharedPaths step 'I visit \'bug\' label edit page' do - visit edit_namespace_project_label_path(project.namespace, project, bug_label) + visit edit_project_label_path(project, bug_label) end step 'I remove label \'bug\'' do diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index 54d7475f8da..d6c1c73ae83 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -65,7 +65,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I should not see "master" branch' do - expect(find('.merge-request-info')).not_to have_content "master" + expect(find('.issuable-info')).not_to have_content "master" end step 'I should see "feature_conflict" branch' do @@ -256,7 +256,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps end step 'I switch to the merge request\'s comments tab' do - visit namespace_project_merge_request_path(project.namespace, project, merge_request) + visit project_merge_request_path(project, merge_request) end step 'I click on the commit in the merge request' do diff --git a/features/steps/project/merge_requests/acceptance.rb b/features/steps/project/merge_requests/acceptance.rb index 870dc862992..3c640e3512a 100644 --- a/features/steps/project/merge_requests/acceptance.rb +++ b/features/steps/project/merge_requests/acceptance.rb @@ -1,6 +1,5 @@ class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps include LoginHelpers - include GitlabRoutingHelper include WaitForRequests step 'I am on the Merge Request detail page' do diff --git a/features/steps/project/merge_requests/revert.rb b/features/steps/project/merge_requests/revert.rb index 98d990f112f..25ccf5ab180 100644 --- a/features/steps/project/merge_requests/revert.rb +++ b/features/steps/project/merge_requests/revert.rb @@ -1,6 +1,5 @@ class Spinach::Features::RevertMergeRequests < Spinach::FeatureSteps include LoginHelpers - include GitlabRoutingHelper include WaitForRequests step 'I click on the revert button' do diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb index 370e46265c7..ba98d861e7b 100644 --- a/features/steps/project/network_graph.rb +++ b/features/steps/project/network_graph.rb @@ -12,11 +12,11 @@ class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps Network::Graph.stub(max_count: 10) @project = Project.find_by(name: "Shop") - visit namespace_project_network_path(@project.namespace, @project, "master") + visit project_network_path(@project, "master") end step "I visit project network page on branch 'test'" do - visit namespace_project_network_path(@project.namespace, @project, "'test'") + visit project_network_path(@project, "'test'") end step 'page should select "master" in select box' do diff --git a/features/steps/project/pages.rb b/features/steps/project/pages.rb index 4e6830f738b..275fb4fc010 100644 --- a/features/steps/project/pages.rb +++ b/features/steps/project/pages.rb @@ -15,7 +15,7 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps end step 'I visit the Project Pages' do - visit namespace_project_pages_path(@project.namespace, @project) + visit project_pages_path(@project) end step 'I should see the usage of GitLab Pages' do @@ -75,7 +75,7 @@ class Spinach::Features::ProjectPages < Spinach::FeatureSteps end step 'I visit add a new Pages Domain' do - visit new_namespace_project_pages_domain_path(@project.namespace, @project) + visit new_project_pages_domain_path(@project) end step 'I fill the domain' do diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index 7d34331db46..170e2f16c80 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -38,7 +38,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps step 'I should see new project avatar' do expect(@project.avatar).to be_instance_of AvatarUploader url = @project.avatar.url - expect(url).to eq "/uploads/system/project/avatar/#{@project.id}/banana_sample.gif" + expect(url).to eq "/uploads/-/system/project/avatar/#{@project.id}/banana_sample.gif" end step 'I should see the "Remove avatar" button' do diff --git a/features/steps/project/project_group_links.rb b/features/steps/project/project_group_links.rb index 5280a38ce81..47ee31786a6 100644 --- a/features/steps/project/project_group_links.rb +++ b/features/steps/project/project_group_links.rb @@ -42,7 +42,7 @@ class Spinach::Features::ProjectGroupLinks < Spinach::FeatureSteps end step 'I visit project group links page' do - visit namespace_project_group_links_path(project.namespace, project) + visit project_group_links_path(project) end def project diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb index 92936f27c20..b2ceb8dd9a8 100644 --- a/features/steps/project/redirects.rb +++ b/features/steps/project/redirects.rb @@ -13,7 +13,7 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I visit project "Community" page' do project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I should see project "Community" home page' do @@ -25,12 +25,12 @@ class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps step 'I visit project "Enterprise" page' do project = Project.find_by(name: 'Enterprise') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I visit project "CommunityDoesNotExist" page' do project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) + 'DoesNotExist' + visit project_path(project) + 'DoesNotExist' end step 'I click on "Sign In"' do diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb index 6bac4df16f8..7e2a357f6b2 100644 --- a/features/steps/project/services.rb +++ b/features/steps/project/services.rb @@ -4,7 +4,7 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps include SharedPaths step 'I visit project "Shop" services page' do - visit namespace_project_settings_integrations_path(@project.namespace, @project) + visit project_settings_integrations_path(@project) end step 'I should see list of available services' do @@ -175,7 +175,6 @@ class Spinach::Features::ProjectServices < Spinach::FeatureSteps fill_in 'JIRA API URL', with: 'http://jira.example/api' fill_in 'Username', with: 'gitlab' fill_in 'Password', with: 'gitlab' - fill_in 'Project Key', with: 'GITLAB' click_button 'Save' end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb index dd49701a3d9..b0407d3f07d 100644 --- a/features/steps/project/snippets.rb +++ b/features/steps/project/snippets.rb @@ -91,7 +91,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps end step 'I visit snippet page "Snippet one"' do - visit namespace_project_snippet_path(project.namespace, project, project_snippet) + visit project_snippet_path(project, project_snippet) end def project_snippet diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb index 80aa3a047a0..621cae5d80d 100644 --- a/features/steps/project/source/browse_files.rb +++ b/features/steps/project/source/browse_files.rb @@ -9,7 +9,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step "I don't have write access" do @project = create(:project, :repository, name: "Other Project", path: "other-project") @project.team << [@user, :reporter] - visit namespace_project_tree_path(@project.namespace, @project, root_ref) + visit project_tree_path(@project, root_ref) end step 'I should see files from repository' do @@ -19,7 +19,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I should see files from repository for "6d39438"' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "6d39438") + expect(current_path).to eq project_tree_path(@project, "6d39438") expect(page).to have_content ".gitignore" expect(page).to have_content "LICENSE" end @@ -92,10 +92,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps fill_in :branch_name, with: 'new_branch_name', visible: true end - step 'I fill the new file name with an illegal name' do - fill_in :file_name, with: 'Spaces Not Allowed' - end - step 'I fill the new file name with a new directory' do fill_in :file_name, with: new_file_name_with_directory end @@ -240,16 +236,16 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I am redirected to the files URL' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, 'master') + expect(current_path).to eq project_tree_path(@project, 'master') end step 'I am redirected to the ".gitignore"' do - expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore')) + expect(current_path).to eq(project_blob_path(@project, 'master/.gitignore')) end step 'I am redirected to the permalink URL' do expect(current_path).to( - eq(namespace_project_blob_path(@project.namespace, @project, + eq(project_blob_path(@project, @project.repository.commit.sha + '/.gitignore')) ) @@ -257,26 +253,26 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I am redirected to the new file' do expect(current_path).to eq( - namespace_project_blob_path(@project.namespace, @project, 'master/' + new_file_name)) + project_blob_path(@project, 'master/' + new_file_name)) end step 'I am redirected to the new file with directory' do expect(current_path).to eq( - namespace_project_blob_path(@project.namespace, @project, 'master/' + new_file_name_with_directory)) + project_blob_path(@project, 'master/' + new_file_name_with_directory)) end step 'I am redirected to the new merge request page' do - expect(current_path).to eq(new_namespace_project_merge_request_path(@project.namespace, @project)) + expect(current_path).to eq(project_new_merge_request_path(@project)) end step "I am redirected to the fork's new merge request page" do fork = @user.fork_of(@project) - expect(current_path).to eq(new_namespace_project_merge_request_path(fork.namespace, fork)) + expect(current_path).to eq(project_new_merge_request_path(fork)) end step 'I am redirected to the root directory' do expect(current_path).to eq( - namespace_project_tree_path(@project.namespace, @project, 'master')) + project_tree_path(@project, 'master')) end step "I don't see the permalink link" do @@ -327,11 +323,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step "I visit the 'test' tree" do - visit namespace_project_tree_path(@project.namespace, @project, "'test'") + visit project_tree_path(@project, "'test'") end step "I visit the fix tree" do - visit namespace_project_tree_path(@project.namespace, @project, "fix/.testdir") + visit project_tree_path(@project, "fix/.testdir") end step 'I see the commit data' do @@ -346,7 +342,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps step 'I click on "files/lfs/lfs_object.iso" file in repo' do allow_any_instance_of(Project).to receive(:lfs_enabled?).and_return(true) - visit namespace_project_tree_path(@project.namespace, @project, "lfs") + visit project_tree_path(@project, "lfs") click_link 'files' click_link "lfs" click_link "lfs_object.iso" @@ -369,7 +365,6 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps expect(page).to have_content 'Permalink' expect(page).not_to have_content 'Edit' expect(page).not_to have_content 'Blame' - expect(page).not_to have_content 'Annotate' expect(page).to have_content 'Delete' expect(page).to have_content 'Replace' end @@ -390,7 +385,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps end step 'I visit the SVG file' do - visit namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/logo_sample.svg') + visit project_blob_path(@project, 'new_branch_name/logo_sample.svg') end step 'I can see the new rendered SVG image' do diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb index cf31e61437e..243a0f54f7f 100644 --- a/features/steps/project/source/markdown_render.rb +++ b/features/steps/project/source/markdown_render.rb @@ -14,7 +14,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see files from repository in markdown' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown") + expect(current_path).to eq project_tree_path(@project, "markdown") expect(page).to have_content "README.md" expect(page).to have_content "CHANGELOG" end @@ -34,7 +34,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "All API requests require authentication" end @@ -44,7 +44,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct directory rendered' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/raketasks") expect(page).to have_content "backup_restore.md" expect(page).to have_content "maintenance.md" end @@ -54,7 +54,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct doc/api directory rendered' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/api") expect(page).to have_content "README.md" expect(page).to have_content "users.md" end @@ -64,7 +64,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct maintenance file rendered' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/raketasks/maintenance.md") wait_for_requests expect(page).to have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" end @@ -98,7 +98,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see correct file rendered' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "Contents" expect(page).to have_link "Users" @@ -110,7 +110,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct document file' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") expect(page).to have_content "Get a list of users." end @@ -121,30 +121,30 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps # Markdown branch When 'I visit markdown branch' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown") + visit project_tree_path(@project, "markdown") wait_for_requests end When 'I visit markdown branch "README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + visit project_blob_path(@project, "markdown/README.md") end When 'I visit markdown branch "d" tree' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/d") + visit project_tree_path(@project, "markdown/d") end When 'I visit markdown branch "d/README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") + visit project_blob_path(@project, "markdown/d/README.md") end step 'I should see files from repository in markdown branch' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown") + expect(current_path).to eq project_tree_path(@project, "markdown") expect(page).to have_content "README.md" expect(page).to have_content "CHANGELOG" end step 'I see correct file rendered in markdown branch' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "Contents" expect(page).to have_link "Users" @@ -152,19 +152,19 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see correct document rendered for markdown branch' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/README.md") wait_for_requests expect(page).to have_content "All API requests require authentication" end step 'I should see correct directory rendered for markdown branch' do - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/raketasks") expect(page).to have_content "backup_restore.md" expect(page).to have_content "maintenance.md" end step 'I should see the users document file in markdown branch' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") expect(page).to have_content "Get a list of users." end @@ -172,54 +172,54 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps step 'The link with text "empty" should have url "tree/markdown"' do wait_for_requests - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown") end step 'The link with text "empty" should have url "blob/markdown/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") end step 'The link with text "empty" should have url "tree/markdown/d"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown/d") + find('a', text: /^empty$/)['href'] == current_host + project_tree_path(@project, "markdown/d") end step 'The link with text "empty" should have '\ 'url "blob/markdown/d/README.md"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/d/README.md") + find('a', text: /^empty$/)['href'] == current_host + project_blob_path(@project, "markdown/d/README.md") end step 'The link with text "ID" should have url "tree/markdownID"' do - find('a', text: /^#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' + find('a', text: /^#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' end step 'The link with text "/ID" should have url "tree/markdownID"' do - find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @project, "markdown") + '#id' + find('a', text: /^\/#id$/)['href'] == current_host + project_tree_path(@project, "markdown") + '#id' end step 'The link with text "README.mdID" '\ 'should have url "blob/markdown/README.mdID"' do - find('a', text: /^README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' + find('a', text: /^README.md#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end step 'The link with text "d/README.mdID" should have '\ 'url "blob/markdown/d/README.mdID"' do - find('a', text: /^d\/README.md#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "d/markdown/README.md") + '#id' + find('a', text: /^d\/README.md#id$/)['href'] == current_host + project_blob_path(@project, "d/markdown/README.md") + '#id' end step 'The link with text "ID" should have url "blob/markdown/README.mdID"' do wait_for_requests - find('a', text: /^#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' + find('a', text: /^#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end step 'The link with text "/ID" should have url "blob/markdown/README.mdID"' do - find('a', text: /^\/#id$/)['href'] == current_host + namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") + '#id' + find('a', text: /^\/#id$/)['href'] == current_host + project_blob_path(@project, "markdown/README.md") + '#id' end # Wiki step 'I go to wiki page' do click_link "Wiki" - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + expect(current_path).to eq project_wiki_path(@project, "home") end step 'I add various links to the wiki page' do @@ -231,7 +231,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'Wiki page should have added links' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + expect(current_path).to eq project_wiki_path(@project, "home") expect(page).to have_content "test GitLab API doc Rake tasks" end @@ -252,7 +252,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see new wiki page named test' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "test") + expect(current_path).to eq project_wiki_path(@project, "test") page.within(:css, ".nav-text") do expect(page).to have_content "Test" @@ -261,8 +261,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end When 'I go back to wiki page home' do - visit namespace_project_wiki_path(@project.namespace, @project, "home") - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "home") + visit project_wiki_path(@project, "home") + expect(current_path).to eq project_wiki_path(@project, "home") end step 'I click on GitLab API doc link' do @@ -270,7 +270,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Gitlab API document' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "api") + expect(current_path).to eq project_wiki_path(@project, "api") page.within(:css, ".nav-text") do expect(page).to have_content "Create" @@ -283,7 +283,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I see Rake tasks directory' do - expect(current_path).to eq namespace_project_wiki_path(@project.namespace, @project, "raketasks") + expect(current_path).to eq project_wiki_path(@project, "raketasks") page.within(:css, ".nav-text") do expect(page).to have_content "Create" @@ -292,8 +292,8 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I go directory which contains README file' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - expect(current_path).to eq namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") + visit project_tree_path(@project, "markdown/doc/api") + expect(current_path).to eq project_tree_path(@project, "markdown/doc/api") end step 'I click on a relative link in README' do @@ -301,7 +301,7 @@ class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps end step 'I should see the correct markdown' do - expect(current_path).to eq namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") + expect(current_path).to eq project_blob_path(@project, "markdown/doc/api/users.md") wait_for_requests expect(page).to have_content "List users" end diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb index 517c257d892..6a478c50e5e 100644 --- a/features/steps/project/wiki.rb +++ b/features/steps/project/wiki.rb @@ -11,7 +11,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to the Edit Home Wiki page' do - expect(current_path).to eq namespace_project_wiki_path(project.namespace, project, :home) + expect(current_path).to eq project_wiki_path(project, :home) end step 'I create the Wiki Home page' do @@ -42,7 +42,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I browse to that Wiki page' do - visit namespace_project_wiki_path(project.namespace, project, @page) + visit project_wiki_path(project, @page) end step 'I click on the Edit button' do @@ -59,11 +59,11 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I should be redirected back to that Wiki page' do - expect(current_path).to eq namespace_project_wiki_path(project.namespace, project, @page) + expect(current_path).to eq project_wiki_path(project, @page) end step 'That page has two revisions' do - @page.update("new content", :markdown, "second commit") + @page.update("new content", message: "second commit") end step 'I click the History button' do @@ -95,7 +95,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'I browse to wiki page with images' do - visit namespace_project_wiki_path(project.namespace, project, @wiki_page) + visit project_wiki_path(project, @wiki_page) end step 'I click on existing image link' do @@ -114,7 +114,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps end step 'Image should be shown on the page' do - expect(page).to have_xpath("//img[@src=\"image.jpg\"]") + expect(page).to have_xpath("//img[@data-src=\"image.jpg\"]") end step 'I click on image link' do diff --git a/features/steps/shared/builds.rb b/features/steps/shared/builds.rb index 624f1a7858b..3b4c98ec00d 100644 --- a/features/steps/shared/builds.rb +++ b/features/steps/shared/builds.rb @@ -27,11 +27,11 @@ module SharedBuilds end step 'I visit recent build details page' do - visit namespace_project_job_path(@project.namespace, @project, @build) + visit project_job_path(@project, @build) end step 'I visit project builds page' do - visit namespace_project_jobs_path(@project.namespace, @project) + visit project_jobs_path(@project) end step 'recent build has artifacts available' do @@ -56,7 +56,7 @@ module SharedBuilds end step 'I access artifacts download page' do - visit download_namespace_project_job_artifacts_path(@project.namespace, @project, @build) + visit download_project_job_artifacts_path(@project, @build) end step 'I see details of a build' do diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb index 5c6a4fbc6d4..312187cbd0f 100644 --- a/features/steps/shared/diff_note.rb +++ b/features/steps/shared/diff_note.rb @@ -232,7 +232,7 @@ module SharedDiffNote end def click_parallel_diff_line(code, line_type) - find(".line_content.parallel.#{line_type}[data-line-code='#{code}']").trigger 'mouseover' + find(".line_holder.parallel .diff-line-num[id='#{code}']").trigger 'mouseover' find(".line_holder.parallel button[data-line-code='#{code}']").click end end diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb index 3d9cedf5c2d..7c842ba88fb 100644 --- a/features/steps/shared/issuable.rb +++ b/features/steps/shared/issuable.rb @@ -51,22 +51,22 @@ module SharedIssuable step 'I visit issue page "Enterprise issue"' do issue = Issue.find_by(title: 'Enterprise issue') - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) + visit project_issue_path(issue.project, issue) end step 'I visit merge request page "Enterprise fix"' do mr = MergeRequest.find_by(title: 'Enterprise fix') - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) + visit project_merge_request_path(mr.target_project, mr) end step 'I visit issue page "Community issue"' do issue = Issue.find_by(title: 'Community issue') - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) + visit project_issue_path(issue.project, issue) end step 'I visit issue page "Community fix"' do mr = MergeRequest.find_by(title: 'Community fix') - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) + visit project_merge_request_path(mr.target_project, mr) end step 'I should not see any related merge requests' do diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index f0e751b820a..830263fd038 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -112,10 +112,6 @@ module SharedPaths visit dashboard_groups_path end - step 'I visit dashboard todos page' do - visit dashboard_todos_path - end - step 'I should be redirected to the dashboard groups page' do expect(current_path).to eq dashboard_groups_path end @@ -205,67 +201,67 @@ module SharedPaths # ---------------------------------------- step "I visit my project's home page" do - visit namespace_project_path(@project.namespace, @project) + visit project_path(@project) end step "I visit my project's settings page" do - visit edit_namespace_project_path(@project.namespace, @project) + visit edit_project_path(@project) end step "I visit my project's files page" do - visit namespace_project_tree_path(@project.namespace, @project, root_ref) + visit project_tree_path(@project, root_ref) end step 'I visit a binary file in the repo' do - visit namespace_project_blob_path(@project.namespace, @project, + visit project_blob_path(@project, File.join(root_ref, 'files/images/logo-black.png')) end step "I visit my project's commits page" do - visit namespace_project_commits_path(@project.namespace, @project, root_ref, { limit: 5 }) + visit project_commits_path(@project, root_ref, { limit: 5 }) end step "I visit my project's commits page for a specific path" do - visit namespace_project_commits_path(@project.namespace, @project, root_ref + "/app/models/project.rb", { limit: 5 }) + visit project_commits_path(@project, root_ref + "/app/models/project.rb", { limit: 5 }) end step 'I visit my project\'s commits stats page' do - visit stats_namespace_project_repository_path(@project.namespace, @project) + visit stats_project_repository_path(@project) end step "I visit my project's graph page" do # Stub Graph max_size to speed up test (10 commits vs. 650) Network::Graph.stub(max_count: 10) - visit namespace_project_network_path(@project.namespace, @project, root_ref) + visit project_network_path(@project, root_ref) end step "I visit my project's issues page" do - visit namespace_project_issues_path(@project.namespace, @project) + visit project_issues_path(@project) end step "I visit my project's merge requests page" do - visit namespace_project_merge_requests_path(@project.namespace, @project) + visit project_merge_requests_path(@project) end step "I visit my project's members page" do - visit namespace_project_project_members_path(@project.namespace, @project) + visit project_project_members_path(@project) end step "I visit my project's wiki page" do - visit namespace_project_wiki_path(@project.namespace, @project, :home) + visit project_wiki_path(@project, :home) end step 'I visit project hooks page' do - visit namespace_project_settings_integrations_path(@project.namespace, @project) + visit project_settings_integrations_path(@project) end step 'I visit project deploy keys page' do - visit namespace_project_deploy_keys_path(@project.namespace, @project) + visit project_deploy_keys_path(@project) end step 'I visit project find file page' do - visit namespace_project_find_file_path(@project.namespace, @project, root_ref) + visit project_find_file_path(@project, root_ref) end # ---------------------------------------- @@ -273,107 +269,107 @@ module SharedPaths # ---------------------------------------- step 'I visit project "Shop" page' do - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I visit project "Shop" activity page' do - visit activity_namespace_project_path(project.namespace, project) + visit activity_project_path(project) end step 'I visit project "Forked Shop" merge requests page' do - visit namespace_project_merge_requests_path(@forked_project.namespace, @forked_project) + visit project_merge_requests_path(@forked_project) end step 'I visit edit project "Shop" page' do - visit edit_namespace_project_path(project.namespace, project) + visit edit_project_path(project) end step 'I visit project branches page' do - visit namespace_project_branches_path(@project.namespace, @project) + visit project_branches_path(@project) end step 'I visit project protected branches page' do - visit namespace_project_protected_branches_path(@project.namespace, @project) + visit project_protected_branches_path(@project) end step 'I visit compare refs page' do - visit namespace_project_compare_index_path(@project.namespace, @project) + visit project_compare_index_path(@project) end step 'I visit project commits page' do - visit namespace_project_commits_path(@project.namespace, @project, root_ref, { limit: 5 }) + visit project_commits_path(@project, root_ref, { limit: 5 }) end step 'I visit project commits page for stable branch' do - visit namespace_project_commits_path(@project.namespace, @project, 'stable', { limit: 5 }) + visit project_commits_path(@project, 'stable', { limit: 5 }) end step 'I visit project source page' do - visit namespace_project_tree_path(@project.namespace, @project, root_ref) + visit project_tree_path(@project, root_ref) end step 'I visit blob file from repo' do - visit namespace_project_blob_path(@project.namespace, @project, File.join(sample_commit.id, sample_blob.path)) + visit project_blob_path(@project, File.join(sample_commit.id, sample_blob.path)) end step 'I visit ".gitignore" file in repo' do - visit namespace_project_blob_path(@project.namespace, @project, File.join(root_ref, '.gitignore')) + visit project_blob_path(@project, File.join(root_ref, '.gitignore')) end step 'I am on the new file page' do - expect(current_path).to eq(namespace_project_create_blob_path(@project.namespace, @project, root_ref)) + expect(current_path).to eq(project_create_blob_path(@project, root_ref)) end step 'I am on the ".gitignore" edit file page' do expect(current_path).to eq( - namespace_project_edit_blob_path(@project.namespace, @project, File.join(root_ref, '.gitignore'))) + project_edit_blob_path(@project, File.join(root_ref, '.gitignore'))) end step 'I visit project source page for "6d39438"' do - visit namespace_project_tree_path(@project.namespace, @project, "6d39438") + visit project_tree_path(@project, "6d39438") end step 'I visit project source page for' \ ' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do - visit namespace_project_tree_path(@project.namespace, @project, + visit project_tree_path(@project, '6d394385cf567f80a8fd85055db1ab4c5295806f') end step 'I visit project tags page' do - visit namespace_project_tags_path(@project.namespace, @project) + visit project_tags_path(@project) end step 'I visit project commit page' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) + visit project_commit_path(@project, sample_commit.id) end step 'I visit project "Shop" issues page' do - visit namespace_project_issues_path(project.namespace, project) + visit project_issues_path(project) end step 'I visit issue page "Release 0.4"' do issue = Issue.find_by(title: "Release 0.4") - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) + visit project_issue_path(issue.project, issue) end step 'I visit project "Shop" labels page' do project = Project.find_by(name: 'Shop') - visit namespace_project_labels_path(project.namespace, project) + visit project_labels_path(project) end step 'I visit project "Forum" labels page' do project = Project.find_by(name: 'Forum') - visit namespace_project_labels_path(project.namespace, project) + visit project_labels_path(project) end step 'I visit project "Shop" new label page' do project = Project.find_by(name: 'Shop') - visit new_namespace_project_label_path(project.namespace, project) + visit new_project_label_path(project) end step 'I visit project "Forum" new label page' do project = Project.find_by(name: 'Forum') - visit new_namespace_project_label_path(project.namespace, project) + visit new_project_label_path(project) end step 'I visit merge request page "Bug NS-04"' do @@ -398,28 +394,28 @@ module SharedPaths step 'I visit merge request page "Bug CO-01"' do mr = MergeRequest.find_by(title: "Bug CO-01") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) + visit project_merge_request_path(mr.target_project, mr) wait_for_requests end step 'I visit project "Shop" merge requests page' do - visit namespace_project_merge_requests_path(project.namespace, project) + visit project_merge_requests_path(project) end step 'I visit forked project "Shop" merge requests page' do - visit namespace_project_merge_requests_path(project.namespace, project) + visit project_merge_requests_path(project) end step 'I visit project "Shop" milestones page' do - visit namespace_project_milestones_path(project.namespace, project) + visit project_milestones_path(project) end step 'I visit project "Shop" team page' do - visit namespace_project_project_members_path(project.namespace, project) + visit project_project_members_path(project) end step 'I visit project wiki page' do - visit namespace_project_wiki_path(@project.namespace, @project, :home) + visit project_wiki_path(@project, :home) end # ---------------------------------------- @@ -428,22 +424,22 @@ module SharedPaths step 'I visit project "Community" page' do project = Project.find_by(name: "Community") - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I visit project "Community" source page' do project = Project.find_by(name: 'Community') - visit namespace_project_tree_path(project.namespace, project, root_ref) + visit project_tree_path(project, root_ref) end step 'I visit project "Internal" page' do project = Project.find_by(name: "Internal") - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I visit project "Enterprise" page' do project = Project.find_by(name: "Enterprise") - visit namespace_project_path(project.namespace, project) + visit project_path(project) end # ---------------------------------------- @@ -452,7 +448,7 @@ module SharedPaths step "I visit empty project page" do project = Project.find_by(name: "Empty Public Project") - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step "I should not see command line instructions" do @@ -484,17 +480,13 @@ module SharedPaths # ---------------------------------------- step 'I visit project "Shop" snippets page' do - visit namespace_project_snippets_path(project.namespace, project) + visit project_snippets_path(project) end step 'I visit snippets page' do visit explore_snippets_path end - step 'I visit new snippet page' do - visit new_snippet_path - end - def root_ref @project.repository.root_ref end @@ -505,7 +497,7 @@ module SharedPaths def merge_request_path(title) mr = MergeRequest.find_by(title: title) - namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) + project_merge_request_path(mr.target_project, mr) end # ---------------------------------------- diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb index c4f1c57836f..da1cdd9f897 100644 --- a/features/steps/shared/project.rb +++ b/features/steps/shared/project.rb @@ -61,12 +61,12 @@ module SharedProject step 'I visit my empty project page' do project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'I visit project "Shop" activity page' do project = Project.find_by(name: 'Shop') - visit namespace_project_path(project.namespace, project) + visit project_path(project) end step 'project "Shop" has push event' do @@ -101,7 +101,7 @@ module SharedProject end step 'I should see project settings' do - expect(current_path).to eq edit_namespace_project_path(@project.namespace, @project) + expect(current_path).to eq edit_project_path(@project) expect(page).to have_content("Project name") expect(page).to have_content("Sharing & Permissions") end @@ -239,11 +239,6 @@ module SharedProject create(:label, project: project, title: 'enhancement') end - step 'project "Shop" has issue: "bug report"' do - project = Project.find_by(name: "Shop") - create(:issue, project: project, title: "bug report") - end - step 'project "Shop" has CI enabled' do project = Project.find_by(name: "Shop") project.enable_ci diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb index 0cb9229dbae..901f7f76ee9 100644 --- a/features/steps/shared/project_tab.rb +++ b/features/steps/shared/project_tab.rb @@ -32,6 +32,10 @@ module SharedProjectTab ensure_active_main_tab('Wiki') end + step 'the active main tab should be Members' do + ensure_active_main_tab('Members') + end + step 'the active main tab should be Settings' do ensure_active_main_tab('Settings') end diff --git a/features/steps/shared/snippet.rb b/features/steps/shared/snippet.rb deleted file mode 100644 index bb596c1620a..00000000000 --- a/features/steps/shared/snippet.rb +++ /dev/null @@ -1,63 +0,0 @@ -module SharedSnippet - include Spinach::DSL - - step 'I have public "Personal snippet one" snippet' do - create(:personal_snippet, - title: "Personal snippet one", - content: "Test content", - file_name: "snippet.rb", - visibility_level: Snippet::PUBLIC, - author: current_user) - end - - step 'I have private "Personal snippet private" snippet' do - create(:personal_snippet, - title: "Personal snippet private", - content: "Provate content", - file_name: "private_snippet.rb", - visibility_level: Snippet::PRIVATE, - author: current_user) - end - - step 'I have internal "Personal snippet internal" snippet' do - create(:personal_snippet, - title: "Personal snippet internal", - content: "Provate content", - file_name: "internal_snippet.rb", - visibility_level: Snippet::INTERNAL, - author: current_user) - end - - step 'I have a public many lined snippet' do - create(:personal_snippet, - title: 'Many lined snippet', - content: <<-END.gsub(/^\s+\|/, ''), - |line one - |line two - |line three - |line four - |line five - |line six - |line seven - |line eight - |line nine - |line ten - |line eleven - |line twelve - |line thirteen - |line fourteen - END - file_name: 'many_lined_snippet.rb', - visibility_level: Snippet::PUBLIC, - author: current_user) - end - - step 'There is public "Personal snippet one" snippet' do - create(:personal_snippet, - title: "Personal snippet one", - content: "Test content", - file_name: "snippet.rb", - visibility_level: Snippet::PUBLIC, - author: create(:user)) - end -end diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb deleted file mode 100644 index a4fc77746ee..00000000000 --- a/features/steps/snippets/snippets.rb +++ /dev/null @@ -1,86 +0,0 @@ -class Spinach::Features::Snippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedSnippet - include WaitForRequests - - step 'I click link "Personal snippet one"' do - click_link "Personal snippet one" - end - - step 'I should not see "Personal snippet one" in snippets' do - expect(page).not_to have_content "Personal snippet one" - end - - step 'I click link "Edit"' do - page.within ".detail-page-header" do - first(:link, "Edit").click - end - end - - step 'I click link "Delete"' do - first(:link, "Delete").click - end - - step 'I submit new snippet "Personal snippet three"' do - fill_in "personal_snippet_title", with: "Personal snippet three" - fill_in "personal_snippet_file_name", with: "my_snippet.rb" - page.within('.file-editor') do - find('.ace_editor').native.send_keys 'Content of snippet three' - end - click_button "Create snippet" - wait_for_requests - end - - step 'I submit new internal snippet' do - fill_in "personal_snippet_title", with: "Internal personal snippet one" - fill_in "personal_snippet_file_name", with: "my_snippet.rb" - choose 'personal_snippet_visibility_level_10' - - page.within('.file-editor') do - find(:xpath, "//input[@id='personal_snippet_content']").set 'Content of internal snippet' - end - - click_button "Create snippet" - end - - step 'I should see snippet "Personal snippet three"' do - expect(page).to have_content "Personal snippet three" - expect(page).to have_content "Content of snippet three" - end - - step 'I submit new title "Personal snippet new title"' do - fill_in "personal_snippet_title", with: "Personal snippet new title" - click_button "Save" - end - - step 'I should see "Personal snippet new title"' do - expect(page).to have_content "Personal snippet new title" - end - - step 'I uncheck "Private" checkbox' do - choose "Internal" - click_button "Save" - end - - step 'I should see "Personal snippet one" public' do - expect(page).to have_no_xpath("//i[@class='public-snippet']") - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - step 'I visit snippet page "Internal personal snippet one"' do - visit snippet_path(internal_snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end - - def internal_snippet - @snippet ||= PersonalSnippet.find_by!(title: "Internal personal snippet one") - end -end diff --git a/features/support/env.rb b/features/support/env.rb index 1690465d9b2..608d988755c 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -28,6 +28,7 @@ Spinach.hooks.before_run do TestEnv.disable_pre_receive include FactoryGirl::Syntax::Methods + include GitlabRoutingHelper end Spinach.hooks.after_scenario do |scenario_data, step_definitions| |