diff options
Diffstat (limited to 'features')
153 files changed, 0 insertions, 10393 deletions
diff --git a/features/admin/active_tab.feature b/features/admin/active_tab.feature deleted file mode 100644 index 5de07e90e28..00000000000 --- a/features/admin/active_tab.feature +++ /dev/null @@ -1,44 +0,0 @@ -@admin -Feature: Admin Active Tab - Background: - Given I sign in as an admin - - Scenario: On Admin Home - Given I visit admin page - Then the active main tab should be Home - And no other main tabs should be active - - Scenario: On Admin Projects - Given I visit admin projects page - Then the active main tab should be Projects - And no other main tabs should be active - - Scenario: On Admin Groups - Given I visit admin groups page - Then the active main tab should be Groups - And no other main tabs should be active - - Scenario: On Admin Users - Given I visit admin users page - Then the active main tab should be Users - And no other main tabs should be active - - Scenario: On Admin Logs - Given I visit admin logs page - Then the active main tab should be Logs - And no other main tabs should be active - - Scenario: On Admin Messages - Given I visit admin messages page - Then the active main tab should be Messages - And no other main tabs should be active - - Scenario: On Admin Hooks - Given I visit admin hooks page - Then the active main tab should be Hooks - And no other main tabs should be active - - Scenario: On Admin Resque - Given I visit admin Resque page - Then the active main tab should be Resque - And no other main tabs should be active diff --git a/features/admin/applications.feature b/features/admin/applications.feature deleted file mode 100644 index 2a00e1666c0..00000000000 --- a/features/admin/applications.feature +++ /dev/null @@ -1,18 +0,0 @@ -@admin -Feature: Admin Applications - Background: - Given I sign in as an admin - And I visit applications page - - Scenario: I can manage application - Then I click on new application button - And I should see application form - Then I fill application form out and submit - And I see application - Then I click edit - And I see edit application form - Then I change name of application and submit - And I see that application was changed - Then I visit applications page - And I click to remove application - Then I see that application is removed
\ No newline at end of file diff --git a/features/admin/broadcast_messages.feature b/features/admin/broadcast_messages.feature deleted file mode 100644 index b2c3112320a..00000000000 --- a/features/admin/broadcast_messages.feature +++ /dev/null @@ -1,21 +0,0 @@ -@admin -Feature: Admin Broadcast Messages - Background: - Given I sign in as an admin - And application already has admin messages - And I visit admin messages page - - Scenario: See broadcast messages list - Then I should be all broadcast messages - - Scenario: Create a broadcast message - When submit form with new broadcast message - Then I should be redirected to admin messages page - And I should see newly created broadcast message - - Scenario: Create a customized broadcast message - When submit form with new customized broadcast message - Then I should be redirected to admin messages page - And I should see newly created broadcast message - Then I visit dashboard page - And I should see a customized broadcast message diff --git a/features/admin/deploy_keys.feature b/features/admin/deploy_keys.feature deleted file mode 100644 index 9df47eb51fd..00000000000 --- a/features/admin/deploy_keys.feature +++ /dev/null @@ -1,21 +0,0 @@ -@admin -Feature: Admin Deploy Keys - Background: - Given I sign in as an admin - And there are public deploy keys in system - - Scenario: Deploy Keys list - When I visit admin deploy keys page - Then I should see all public deploy keys - - Scenario: Deploy Keys show - When I visit admin deploy keys page - And I click on first deploy key - Then I should see deploy key details - - Scenario: Deploy Keys new - When I visit admin deploy keys page - And I click 'New Deploy Key' - And I submit new deploy key - Then I should be on admin deploy keys page - And I should see newly created deploy key diff --git a/features/admin/groups.feature b/features/admin/groups.feature deleted file mode 100644 index aa365a6ea1a..00000000000 --- a/features/admin/groups.feature +++ /dev/null @@ -1,29 +0,0 @@ -@admin -Feature: Admin Groups - Background: - Given I sign in as an admin - And I have group with projects - And User "John Doe" exists - And I visit admin groups page - - Scenario: See group list - Then I should be all groups - - Scenario: Create a group - When I click new group link - And submit form with new group info - Then I should be redirected to group page - And I should see newly created group - - @javascript - Scenario: Add user into projects in group - When I visit admin group page - When I select user "John Doe" from user list as "Reporter" - Then I should see "John Doe" in team list in every project as "Reporter" - - @javascript - Scenario: Remove user from group - Given we have user "John Doe" in group - When I visit admin group page - And I remove user "John Doe" from group - Then I should not see "John Doe" in team list diff --git a/features/admin/logs.feature b/features/admin/logs.feature deleted file mode 100644 index ceb3bc34927..00000000000 --- a/features/admin/logs.feature +++ /dev/null @@ -1,8 +0,0 @@ -@admin -Feature: Admin Logs - Background: - Given I sign in as an admin - - Scenario: On Admin Logs - Given I visit admin logs page - Then I should see tabs with available logs diff --git a/features/admin/projects.feature b/features/admin/projects.feature deleted file mode 100644 index a6c3d6b7822..00000000000 --- a/features/admin/projects.feature +++ /dev/null @@ -1,20 +0,0 @@ -@admin -Feature: Admin Projects - Background: - Given I sign in as an admin - And there are projects in system - - Scenario: Projects list - When I visit admin projects page - Then I should see all projects - - Scenario: Projects show - When I visit admin projects page - And I click on first project - Then I should see project details - - Scenario: Transfer project - Given group 'Web' - And I visit admin project page - When I transfer project to group 'Web' - Then I should see project transfered diff --git a/features/admin/settings.feature b/features/admin/settings.feature deleted file mode 100644 index 52e47307b23..00000000000 --- a/features/admin/settings.feature +++ /dev/null @@ -1,16 +0,0 @@ -@admin -Feature: Admin Settings - Background: - Given I sign in as an admin - And I visit admin settings page - - Scenario: Change application settings - When I modify settings and save form - Then I should see application settings saved - - Scenario: Change Slack Service Template settings - When I click on "Service Templates" - And I click on "Slack" service - Then I check all events and submit form - And I should see service template settings saved - And I should see all checkboxes checked diff --git a/features/admin/users.feature b/features/admin/users.feature deleted file mode 100644 index 1a8720dd77e..00000000000 --- a/features/admin/users.feature +++ /dev/null @@ -1,47 +0,0 @@ -@admin -Feature: Admin Users - Background: - Given I sign in as an admin - And system has users - - Scenario: On Admin Users - Given I visit admin users page - Then I should see all users - - Scenario: Edit user and change username to non ascii char - When I visit admin users page - And Click edit - And Input non ascii char in username - And Click save - Then See username error message - And Not changed form action url - - Scenario: Show user attributes - Given user "Mike" with groups and projects - Given I visit admin users page - And click on "Mike" link - Then I should see user "Mike" details - - Scenario: Edit my user attributes - Given I visit admin users page - And click edit on my user - When I submit modified user - Then I see user attributes changed - -@javascript - Scenario: Remove users secondary email - Given I visit admin users page - And I view the user with secondary email - And I see the secondary email - When I click remove secondary email - Then I should not see secondary email anymore - - Scenario: Show user keys - Given user "Pete" with ssh keys - And I visit admin users page - And click on user "Pete" - Then I should see key list - And I click on the key title - Then I should see key details - And I click on remove key - Then I should see the key removed diff --git a/features/dashboard/active_tab.feature b/features/dashboard/active_tab.feature deleted file mode 100644 index 08b87808f33..00000000000 --- a/features/dashboard/active_tab.feature +++ /dev/null @@ -1,24 +0,0 @@ -@dashboard -Feature: Dashboard Active Tab - Background: - Given I sign in as a user - - Scenario: On Dashboard Home - Given I visit dashboard page - Then the active main tab should be Home - And no other main tabs should be active - - Scenario: On Dashboard Issues - Given I visit dashboard issues page - Then the active main tab should be Issues - And no other main tabs should be active - - Scenario: On Dashboard Merge Requests - Given I visit dashboard merge requests page - Then the active main tab should be Merge Requests - And no other main tabs should be active - - Scenario: On Dashboard Help - Given I visit dashboard help page - Then the active main tab should be Help - And no other main tabs should be active diff --git a/features/dashboard/archived_projects.feature b/features/dashboard/archived_projects.feature deleted file mode 100644 index 69b3a776441..00000000000 --- a/features/dashboard/archived_projects.feature +++ /dev/null @@ -1,12 +0,0 @@ -@dashboard -Feature: Dashboard Archived Projects - Background: - Given I sign in as a user - And I own project "Shop" - And I own project "Forum" - And project "Forum" is archived - And I visit dashboard page - - Scenario: I should see non-archived projects on dashboard - Then I should see "Shop" project link - And I should not see "Forum" project link diff --git a/features/dashboard/dashboard.feature b/features/dashboard/dashboard.feature deleted file mode 100644 index 1959d327082..00000000000 --- a/features/dashboard/dashboard.feature +++ /dev/null @@ -1,37 +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 I visit dashboard page - - @javascript - Scenario: I should see projects list - Then I should see "New Project" link - Then I should see "Shop" project link - 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: I should see User joined Project event - Given user with name "John Doe" joined project "Shop" - When I visit dashboard page - Then I should see "John Doe joined project Shop" event - - @javascript - Scenario: I should see User left Project event - Given user with name "John Doe" joined project "Shop" - And user with name "John Doe" left project "Shop" - When I visit dashboard page - Then I should see "John Doe left project Shop" event diff --git a/features/dashboard/event_filters.feature b/features/dashboard/event_filters.feature deleted file mode 100644 index ec5680caba6..00000000000 --- a/features/dashboard/event_filters.feature +++ /dev/null @@ -1,52 +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 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 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 page - Then I should see push event - And I should see new member event - And I should not see merge request event - When I click "push" event filter - Then I should not see push event - And I should see new member event - And I should not see merge request event diff --git a/features/dashboard/group.feature b/features/dashboard/group.feature deleted file mode 100644 index cf4b8d7283b..00000000000 --- a/features/dashboard/group.feature +++ /dev/null @@ -1,56 +0,0 @@ -@dashboard -Feature: Dashboard Group - Background: - Given I sign in as "John Doe" - And "John Doe" is owner of group "Owned" - And "John Doe" is guest of group "Guest" - - # Leave groups - - @javascript - Scenario: Owner should be able to leave from group if he is not the last owner - Given "Mary Jane" is owner of group "Owned" - When I visit dashboard groups page - Then I should see group "Owned" in group list - Then I should see group "Guest" in group list - When I click on the "Leave" button for group "Owned" - And I visit dashboard groups page - Then I should not see group "Owned" in group list - Then I should see group "Guest" in group list - - @javascript - Scenario: Owner should not be able to leave from group if he is the last owner - Given "Mary Jane" is guest of group "Owned" - When I visit dashboard groups page - Then I should see group "Owned" in group list - Then I should see group "Guest" in group list - Then I should not see the "Leave" button for group "Owned" - - @javascript - Scenario: Guest should be able to leave from group - Given "Mary Jane" is guest of group "Guest" - When I visit dashboard groups page - Then I should see group "Owned" in group list - Then I should see group "Guest" in group list - When I click on the "Leave" button for group "Guest" - When I visit dashboard groups page - Then I should see group "Owned" in group list - Then I should not see group "Guest" in group list - - @javascript - Scenario: Guest should be able to leave from group even if he is the only user in the group - When I visit dashboard groups page - Then I should see group "Owned" in group list - Then I should see group "Guest" in group list - When I click on the "Leave" button for group "Guest" - When I visit dashboard groups page - Then I should see group "Owned" in group list - Then I should not see group "Guest" in group list - - Scenario: Create a group from dasboard - And I visit dashboard groups page - And I click new group link - And submit form with new group "Samurai" info - Then I should be redirected to group "Samurai" page - And I should see newly created group "Samurai" - diff --git a/features/dashboard/help.feature b/features/dashboard/help.feature deleted file mode 100644 index bca2772897b..00000000000 --- a/features/dashboard/help.feature +++ /dev/null @@ -1,9 +0,0 @@ -@dashboard -Feature: Dashboard Help - Background: - Given I sign in as a user - And I visit the "Rake Tasks" help page - - Scenario: The markdown should be rendered correctly - Then I should see "Rake Tasks" page markdown rendered - And Header "Rebuild project satellites" should have correct ids and links diff --git a/features/dashboard/issues.feature b/features/dashboard/issues.feature deleted file mode 100644 index 99dad88a402..00000000000 --- a/features/dashboard/issues.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Issues - Background: - Given I sign in as a user - And I have authored issues - And I have assigned issues - And I have other issues - And I visit dashboard issues page - - Scenario: I should see assigned issues - Then I should see issues assigned to me - - @javascript - Scenario: I should see authored issues - When I click "Authored by me" link - Then I should see issues authored by me - - @javascript - Scenario: I should see all issues - When I click "All" link - Then I should see all issues 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 431dc4ccfcb..00000000000 --- a/features/dashboard/new_project.feature +++ /dev/null @@ -1,13 +0,0 @@ -@dashboard -Feature: New Project -Background: - Given I sign in as a user - And I own project "Shop" - And I visit dashboard page - - @javascript - Scenario: I should see New projects page - Given I click "New project" link - Then I see "New project" page - When I click on "Import project from GitHub" - Then I see instructions on how to import from GitHub diff --git a/features/dashboard/shortcuts.feature b/features/dashboard/shortcuts.feature deleted file mode 100644 index 41d79aa6ec8..00000000000 --- a/features/dashboard/shortcuts.feature +++ /dev/null @@ -1,21 +0,0 @@ -@dashboard -Feature: Dashboard Shortcuts - Background: - Given I sign in as a user - And I visit dashboard page - - @javascript - Scenario: Navigate to projects tab - Given I press "g" and "p" - Then the active main tab should be Projects - - @javascript - Scenario: Navigate to issue tab - Given I press "g" and "i" - Then the active main tab should be Issues - - @javascript - Scenario: Navigate to merge requests tab - Given I press "g" and "m" - Then the active main tab should be Merge Requests - diff --git a/features/dashboard/starred_projects.feature b/features/dashboard/starred_projects.feature deleted file mode 100644 index 9dfd2fbab9c..00000000000 --- a/features/dashboard/starred_projects.feature +++ /dev/null @@ -1,12 +0,0 @@ -@dashboard -Feature: Dashboard Starred Projects - Background: - Given I sign in as a user - And public project "Community" - And I starred project "Community" - And I own project "Shop" - And I visit dashboard starred projects page - - Scenario: I should see projects list - Then I should see project "Community" - And I should not see project "Shop" diff --git a/features/explore/groups.feature b/features/explore/groups.feature deleted file mode 100644 index c11634bd74a..00000000000 --- a/features/explore/groups.feature +++ /dev/null @@ -1,147 +0,0 @@ -@public -Feature: Explore Groups - Background: - Given group "TestGroup" has private project "Enterprise" - - Scenario: I should not see group with private projects as visitor - When I visit group "TestGroup" page - Then I should be redirected to sign in page - - Scenario: I should not see group with private projects group as user - When I sign in as a user - And I visit group "TestGroup" page - Then page status code should be 404 - - Scenario: I should not see group with private and internal projects as visitor - Given group "TestGroup" has internal project "Internal" - When I visit group "TestGroup" page - Then I should be redirected to sign in page - - Scenario: I should see group with private and internal projects as user - Given group "TestGroup" has internal project "Internal" - When I sign in as a user - And I visit group "TestGroup" page - Then I should see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group issues for internal project as user - Given group "TestGroup" has internal project "Internal" - When I sign in as a user - And I visit group "TestGroup" issues page - Then I should see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group merge requests for internal project as user - Given group "TestGroup" has internal project "Internal" - When I sign in as a user - And I visit group "TestGroup" merge requests page - Then I should see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group's members as user - Given group "TestGroup" has internal project "Internal" - And "John Doe" is owner of group "TestGroup" - When I sign in as a user - And I visit group "TestGroup" members page - Then I should see group member "John Doe" - And I should not see member roles - - Scenario: I should see group with private, internal and public projects as visitor - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - When I visit group "TestGroup" page - Then I should see project "Community" items - And I should not see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group issues for public project as visitor - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - When I visit group "TestGroup" issues page - Then I should see project "Community" items - And I should not see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group merge requests for public project as visitor - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - When I visit group "TestGroup" merge requests page - Then I should see project "Community" items - And I should not see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group's members as visitor - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - And "John Doe" is owner of group "TestGroup" - When I visit group "TestGroup" members page - Then I should see group member "John Doe" - And I should not see member roles - - Scenario: I should see group with private, internal and public projects as user - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - When I sign in as a user - And I visit group "TestGroup" page - Then I should see project "Community" items - And I should see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group issues for internal and public projects as user - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - When I sign in as a user - And I visit group "TestGroup" issues page - Then I should see project "Community" items - And I should see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group merge requests for internal and public projects as user - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - When I sign in as a user - And I visit group "TestGroup" merge requests page - Then I should see project "Community" items - And I should see project "Internal" items - And I should not see project "Enterprise" items - - Scenario: I should see group's members as user - Given group "TestGroup" has internal project "Internal" - Given group "TestGroup" has public project "Community" - And "John Doe" is owner of group "TestGroup" - When I sign in as a user - And I visit group "TestGroup" members page - Then I should see group member "John Doe" - And I should not see member roles - - Scenario: I should see group with public project in public groups area - Given group "TestGroup" has public project "Community" - When I visit the public groups area - Then I should see group "TestGroup" - - Scenario: I should not see group with internal project in public groups area - Given group "TestGroup" has internal project "Internal" - When I visit the public groups area - Then I should not see group "TestGroup" - - Scenario: I should not see group with private project in public groups area - When I visit the public groups area - Then I should not see group "TestGroup" - - Scenario: I should see group with public project in public groups area as user - Given group "TestGroup" has public project "Community" - When I sign in as a user - And I visit the public groups area - Then I should see group "TestGroup" - - Scenario: I should see group with internal project in public groups area as user - Given group "TestGroup" has internal project "Internal" - When I sign in as a user - And I visit the public groups area - Then I should see group "TestGroup" - - Scenario: I should not see group with private project in public groups area as user - When I sign in as a user - And I visit the public groups area - Then I should not see group "TestGroup" - diff --git a/features/explore/projects.feature b/features/explore/projects.feature deleted file mode 100644 index a1b29722678..00000000000 --- a/features/explore/projects.feature +++ /dev/null @@ -1,116 +0,0 @@ -@public -Feature: Explore Projects - Background: - Given public project "Community" - And internal project "Internal" - And private project "Enterprise" - - Scenario: I visit public area - When I visit the public projects area - Then I should see project "Community" - And I should not see project "Internal" - And I should not see project "Enterprise" - - Scenario: I visit public project page - When I visit project "Community" page - Then I should see project "Community" home page - - Scenario: I visit internal project page - When I visit project "Internal" page - Then I should be redirected to sign in page - - Scenario: I visit private project page - When I visit project "Enterprise" page - Then I should be redirected to sign in page - - Scenario: I visit an empty public project page - Given public empty project "Empty Public Project" - When I visit empty project page - Then I should see empty public project details - And I should see empty public project details with http clone info - - Scenario: I visit an empty public project page as user - Given I sign in as a user - And public empty project "Empty Public Project" - When I visit empty project page - Then I should see empty public project details - And I should see empty public project details with ssh clone info - - Scenario: I visit public area as user - Given I sign in as a user - When I visit the public projects area - Then I should see project "Community" - And I should see project "Internal" - And I should not see project "Enterprise" - - Scenario: I visit internal project page as user - Given I sign in as a user - When I visit project "Internal" page - Then I should see project "Internal" home page - - Scenario: I visit public project page - When I visit project "Community" page - Then I should see project "Community" home page - And I should see an http link to the repository - - Scenario: I visit public project page as user - Given I sign in as a user - When I visit project "Community" page - Then I should see project "Community" home page - And I should see an ssh link to the repository - - Scenario: I visit an empty public project page - Given public empty project "Empty Public Project" - When I visit empty project page - Then I should see empty public project details - - Scenario: I visit public project issues page as a non authorized user - Given I visit project "Community" page - And I visit "Community" issues page - Then I should see list of issues for "Community" project - - Scenario: I visit public project issues page as authorized user - Given I sign in as a user - Given I visit project "Community" page - And I visit "Community" issues page - Then I should see list of issues for "Community" project - - Scenario: I visit internal project issues page as authorized user - Given I sign in as a user - Given I visit project "Internal" page - And I visit "Internal" issues page - Then I should see list of issues for "Internal" project - - Scenario: I visit public project merge requests page as an authorized user - Given I sign in as a user - Given I visit project "Community" page - And I visit "Community" merge requests page - And project "Community" has "Bug fix" open merge request - Then I should see list of merge requests for "Community" project - - Scenario: I visit public project merge requests page as a non authorized user - Given I visit project "Community" page - And I visit "Community" merge requests page - And project "Community" has "Bug fix" open merge request - Then I should see list of merge requests for "Community" project - - Scenario: I visit internal project merge requests page as an authorized user - Given I sign in as a user - Given I visit project "Internal" page - And I visit "Internal" merge requests page - And project "Internal" has "Feature implemented" open merge request - Then I should see list of merge requests for "Internal" project - - Scenario: Trending page - Given I sign in as a user - And project "Community" has comments - When I visit the explore trending projects - Then I should see project "Community" - And I should not see project "Internal" - And I should not see project "Enterprise" - - Scenario: Most starred page - Given I sign in as a user - When I visit the explore starred projects - Then I should see project "Community" - And I should see project "Internal" diff --git a/features/groups.feature b/features/groups.feature deleted file mode 100644 index 415e43d6ae7..00000000000 --- a/features/groups.feature +++ /dev/null @@ -1,150 +0,0 @@ -Feature: Groups - Background: - Given I sign in as "John Doe" - And "John Doe" is owner of group "Owned" - And "John Doe" is guest of group "Guest" - - @javascript - Scenario: I should see group "Owned" dashboard list - When I visit group "Owned" page - Then I should see group "Owned" projects list - And I should see projects activity feed - - Scenario: I should see group "Owned" issues list - Given project from group "Owned" has issues assigned to me - When I visit group "Owned" issues page - Then I should see issues from group "Owned" assigned to me - - Scenario: I should see group "Owned" merge requests list - Given project from group "Owned" has merge requests assigned to me - When I visit group "Owned" merge requests page - Then I should see merge requests from group "Owned" assigned to me - - @javascript - Scenario: I should add user to projects in group "Owned" - Given User "Mary Jane" exists - When I visit group "Owned" members page - And I select user "Mary Jane" from list with role "Reporter" - Then I should see user "Mary Jane" in team list - - Scenario: I should see edit group "Owned" page - When I visit group "Owned" settings page - And I change group "Owned" name to "new-name" - Then I should see new group "Owned" name - - Scenario: I edit group "Owned" avatar - When I visit group "Owned" settings page - And I change group "Owned" avatar - And I visit group "Owned" settings page - Then I should see new group "Owned" avatar - And I should see the "Remove avatar" button - - Scenario: I remove group "Owned" avatar - When I visit group "Owned" settings page - And I have group "Owned" avatar - And I visit group "Owned" settings page - And I remove group "Owned" avatar - Then I should not see group "Owned" avatar - And I should not see the "Remove avatar" button - - @javascript - Scenario: Add user to group - Given gitlab user "Mike" - When I visit group "Owned" members page - And I click link "Add members" - When I select "Mike" as "Reporter" - Then I should see "Mike" in team list as "Reporter" - - @javascript - Scenario: Invite user to group - When I visit group "Owned" members page - And I click link "Add members" - When I select "sjobs@apple.com" as "Reporter" - Then I should see "sjobs@apple.com" in team list as invited "Reporter" - - # 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 - When I search for 'Mary' member - Then I should see user "Mary Jane" in team list - Then I should not see user "John Doe" in team list - - # Group milestones - - Scenario: I should see group "Owned" milestone index page with no milestones - When I visit group "Owned" page - And I click on group milestones - Then I should see group milestones index page has no milestones - - Scenario: I should see group "Owned" milestone index page with milestones - Given Group has projects with milestones - When I visit group "Owned" page - And I click on group milestones - Then I should see group milestones index page with milestones - - Scenario: I should see group "Owned" milestone show page - Given Group has projects with milestones - When I visit group "Owned" page - And I click on group milestones - And I click on one group milestone - 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 diff --git a/features/invites.feature b/features/invites.feature deleted file mode 100644 index dc8eefaeaed..00000000000 --- a/features/invites.feature +++ /dev/null @@ -1,45 +0,0 @@ -Feature: Invites - Background: - Given "John Doe" is owner of group "Owned" - And "John Doe" has invited "user@example.com" to group "Owned" - - Scenario: Viewing invitation when signed out - When I visit the invitation page - Then I should be redirected to the sign in page - And I should see a notice telling me to sign in - - Scenario: Signing in to view invitation - When I visit the invitation page - And I sign in as "Mary Jane" - Then I should be redirected to the invitation page - - Scenario: Viewing invitation when signed in - Given I sign in as "Mary Jane" - And I visit the invitation page - Then I should see the invitation details - And I should see an "Accept invitation" button - And I should see a "Decline" button - - Scenario: Viewing invitation as an existing member - Given I sign in as "John Doe" - And I visit the invitation page - Then I should see a message telling me I'm already a member - - Scenario: Accepting the invitation - Given I sign in as "Mary Jane" - And I visit the invitation page - And I click the "Accept invitation" button - Then I should be redirected to the group page - And I should see a notice telling me I have access - - Scenario: Declining the application when signed in - Given I sign in as "Mary Jane" - And I visit the invitation page - And I click the "Decline" button - Then I should be redirected to the dashboard - And I should see a notice telling me I have declined - - Scenario: Declining the application when signed out - When I visit the invitation's decline page - Then I should be redirected to the sign in page - And I should see a notice telling me I have declined diff --git a/features/profile/active_tab.feature b/features/profile/active_tab.feature deleted file mode 100644 index 7801ae5b8ca..00000000000 --- a/features/profile/active_tab.feature +++ /dev/null @@ -1,29 +0,0 @@ -@profile -Feature: Profile Active Tab - Background: - Given I sign in as a user - - Scenario: On Profile Home - Given I visit profile page - Then the active main tab should be Home - And no other main tabs should be active - - Scenario: On Profile Account - Given I visit profile account page - Then the active main tab should be Account - And no other main tabs should be active - - Scenario: On Profile SSH Keys - Given I visit profile SSH keys page - Then the active main tab should be SSH Keys - And no other main tabs should be active - - Scenario: On Profile Design - Given I visit profile design page - Then the active main tab should be Design - And no other main tabs should be active - - Scenario: On Profile History - Given I visit profile history page - Then the active main tab should be History - And no other main tabs should be active diff --git a/features/profile/emails.feature b/features/profile/emails.feature deleted file mode 100644 index 19ed949f6ae..00000000000 --- a/features/profile/emails.feature +++ /dev/null @@ -1,26 +0,0 @@ -@profile -Feature: Profile Emails - Background: - Given I sign in as a user - And I visit profile emails page - - Scenario: I should see emails - Then I should see my emails - - Scenario: Add new email - Given I submit new email "my@email.com" - Then I should see new email "my@email.com" - And I should see my emails - - Scenario: Add duplicate email - Given I submit duplicate email @user.email - Then I should not have @user.email added - And I should see my emails - - Scenario: Remove email - Given I submit new email "my@email.com" - Then I should see new email "my@email.com" - And I should see my emails - Then I click link "Remove" for "my@email.com" - Then I should not see email "my@email.com" - And I should see my emails diff --git a/features/profile/notifications.feature b/features/profile/notifications.feature deleted file mode 100644 index 55997d44dec..00000000000 --- a/features/profile/notifications.feature +++ /dev/null @@ -1,9 +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 diff --git a/features/profile/profile.feature b/features/profile/profile.feature deleted file mode 100644 index d586167cdf5..00000000000 --- a/features/profile/profile.feature +++ /dev/null @@ -1,99 +0,0 @@ -@profile -Feature: Profile - Background: - Given I sign in as a user - - Scenario: I look at my profile - Given I visit profile page - Then I should see my profile info - - Scenario: I can see groups I belong to - Given I have group with projects - When I visit profile page - And I click on my profile picture - Then I should see my user page - And I should see groups I belong to - - Scenario: I edit profile - Given I visit profile page - Then I change my profile info - And I should see new profile info - - Scenario: I change my password without old one - Given I visit profile password page - When I try change my password w/o old one - Then I should see a missing password error message - And I should be redirected to password page - - Scenario: I change my password - Given I visit profile password page - Then I change my password - And I should be redirected to sign in page - - Scenario: I edit my avatar - Given I visit profile page - Then I change my avatar - And I should see new avatar - And I should see the "Remove avatar" button - - Scenario: I remove my avatar - Given I visit profile page - And I have an avatar - When I remove my avatar - Then I should see my gravatar - And I should not see the "Remove avatar" button - - Scenario: My password is expired - Given my password is expired - And I am not an ldap user - Given I visit profile password page - Then I redirected to expired password page - And I submit new password - And I redirected to sign in page - - Scenario: I unsuccessfully change my password - Given I visit profile password page - When I unsuccessfully change my password - Then I should see a password error message - - Scenario: I reset my token - Given I visit profile account page - Then I reset my token - And I should see new token - - Scenario: I visit history tab - Given I have activity - When I visit profile history page - Then I should see my activity - - Scenario: I visit my user page - When I visit profile page - And I click on my profile picture - Then I should see my user page - - Scenario: I can manage application - Given I visit profile applications page - Then I click on new application button - And I should see application form - Then I fill application form out and submit - And I see application - Then I click edit - And I see edit application form - Then I change name of application and submit - And I see that application was changed - Then I visit profile applications page - And I click to remove application - Then I see that application is removed - - @javascript - Scenario: I change my application theme - Given I visit profile design page - When I change my application theme - Then I should see the theme change immediately - And I should receive feedback that the changes were saved - - @javascript - Scenario: I change my code preview theme - Given I visit profile design page - When I change my code preview theme - Then I should receive feedback that the changes were saved diff --git a/features/profile/ssh_keys.feature b/features/profile/ssh_keys.feature deleted file mode 100644 index 581503fc5f9..00000000000 --- a/features/profile/ssh_keys.feature +++ /dev/null @@ -1,20 +0,0 @@ -@profile -Feature: Profile SSH Keys - Background: - Given I sign in as a user - And I have ssh key "ssh-rsa Work" - And I visit profile keys page - - Scenario: I should see ssh keys - Then I should see my ssh keys - - Scenario: Add new ssh key - Given I click link "Add new" - And I submit new ssh key "Laptop" - Then I should see new ssh key "Laptop" - - Scenario: Remove ssh key - Given I click link "Work" - And I click link "Remove" - Then I visit profile keys page - And I should not see "Work" ssh key diff --git a/features/project/active_tab.feature b/features/project/active_tab.feature deleted file mode 100644 index 05faad4e645..00000000000 --- a/features/project/active_tab.feature +++ /dev/null @@ -1,124 +0,0 @@ -Feature: Project Active Tab - Background: - Given I sign in as a user - And I own a project - - # Main Tabs - - Scenario: On Project Home - Given I visit my project's home page - Then the active main tab should be Home - And no other main tabs should be active - - Scenario: On Project Files - Given I visit my project's files page - Then the active main tab should be Files - And no other main tabs should be active - - Scenario: On Project Commits - Given I visit my project's commits page - Then the active main tab should be Commits - And no other main tabs should be active - - Scenario: On Project Network - Given I visit my project's network page - Then the active main tab should be Network - And no other main tabs should be active - - Scenario: On Project Issues - Given I visit my project's issues page - Then the active main tab should be Issues - And no other main tabs should be active - - Scenario: On Project Merge Requests - Given I visit my project's merge requests page - Then the active main tab should be Merge Requests - And no other main tabs should be active - - Scenario: On Project Wiki - Given I visit my project's wiki page - Then the active main tab should be Wiki - And no other main tabs should be active - - # Sub Tabs: Home - - Scenario: On Project Home/Show - Given I visit my project's home page - Then the active main tab should be Home - And no other main tabs should be active - - # Sub Tabs: Settings - - Scenario: On Project Settings/Team - Given I visit my project's settings page - And I click the "Team" tab - Then the active sub nav should be Team - And no other sub navs should be active - And the active main tab should be Settings - - Scenario: On Project Settings/Edit - Given I visit my project's settings page - And I click the "Edit" tab - Then the active sub nav should be Edit - And no other sub navs should be active - And the active main tab should be Settings - - Scenario: On Project Settings/Hooks - Given I visit my project's settings page - And I click the "Hooks" tab - Then the active sub nav should be Hooks - And no other sub navs should be active - And the active main tab should be Settings - - Scenario: On Project Settings/Deploy Keys - Given I visit my project's settings page - And I click the "Deploy Keys" tab - Then the active sub nav should be Deploy Keys - And no other sub navs should be active - And the active main tab should be Settings - - # Sub Tabs: Commits - - Scenario: On Project Commits/Commits - Given I visit my project's commits page - Then the active sub tab should be Commits - And no other sub tabs should be active - And the active main tab should be Commits - - Scenario: On Project Commits/Compare - Given I visit my project's commits page - And I click the "Compare" tab - Then the active sub tab should be Compare - And no other sub tabs should be active - And the active main tab should be Commits - - Scenario: On Project Commits/Branches - Given I visit my project's commits page - And I click the "Branches" tab - Then the active sub tab should be Branches - And no other sub tabs should be active - And the active main tab should be Commits - - Scenario: On Project Commits/Tags - Given I visit my project's commits page - And I click the "Tags" tab - Then the active sub tab should be Tags - And no other sub tabs should be active - And the active main tab should be Commits - - Scenario: On Project Issues/Browse - Given I visit my project's issues page - Then the active main tab should be Issues - And no other main tabs should be active - - Scenario: On Project Issues/Milestones - Given I visit my project's issues page - And I click the "Milestones" tab - Then the active main tab should be Milestones - And no other main tabs should be active - - Scenario: On Project Issues/Labels - Given I visit my project's issues page - And I click the "Labels" tab - Then the active main tab should be Labels - And no other main tabs should be active diff --git a/features/project/archived.feature b/features/project/archived.feature deleted file mode 100644 index ad466f4f307..00000000000 --- a/features/project/archived.feature +++ /dev/null @@ -1,30 +0,0 @@ -Feature: Project Archived - Background: - Given I sign in as a user - And I own project "Shop" - And I own project "Forum" - - Scenario: I should not see archived on project page of not-archive project - And project "Forum" is archived - And I visit project "Shop" page - Then I should not see "Archived" - - Scenario: I should see archived on project page of archive project - And project "Forum" is archived - And I visit project "Forum" page - Then I should see "Archived" - - Scenario: I archive project - When project "Shop" has push event - And I visit project "Shop" page - And I visit edit project "Shop" page - And I set project archived - Then I should see "Archived" - - Scenario: I unarchive project - When project "Shop" has push event - And project "Shop" is archived - And I visit project "Shop" page - And I visit edit project "Shop" page - And I set project unarchived - Then I should not see "Archived" diff --git a/features/project/commits/branches.feature b/features/project/commits/branches.feature deleted file mode 100644 index 65d8e48b9b3..00000000000 --- a/features/project/commits/branches.feature +++ /dev/null @@ -1,43 +0,0 @@ -Feature: Project Commits Branches - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has protected branches - - Scenario: I can see project all git branches - Given I visit project branches page - Then I should see "Shop" all branches list - - Scenario: I can see project protected git branches - Given I visit project protected branches page - Then I should see "Shop" protected branches list - - Scenario: I create a branch - Given I visit project branches page - And I click new branch link - And I submit new branch form - Then I should see new branch created - - @javascript - Scenario: I delete a branch - Given I visit project branches page - And I click branch 'improve/awesome' delete link - Then I should not see branch 'improve/awesome' - - Scenario: I create a branch with invalid name - Given I visit project branches page - And I click new branch link - And I submit new branch form with invalid name - Then I should see new an error that branch is invalid - - Scenario: I create a branch with invalid reference - Given I visit project branches page - And I click new branch link - And I submit new branch form with invalid reference - Then I should see new an error that ref is invalid - - Scenario: I create a branch that already exists - Given I visit project branches page - And I click new branch link - And I submit new branch form with branch that already exists - Then I should see new an error that branch already exists diff --git a/features/project/commits/comments.feature b/features/project/commits/comments.feature deleted file mode 100644 index c41075d7ad4..00000000000 --- a/features/project/commits/comments.feature +++ /dev/null @@ -1,49 +0,0 @@ -Feature: Project Commits Comments - Background: - Given I sign in as a user - And I own project "Shop" - And I visit project commit page - - @javascript - Scenario: I can comment on a commit - Given I leave a comment like "XML attached" - Then I should see a comment saying "XML attached" - - @javascript - Scenario: I can't cancel the main form - Then I should not see the cancel comment button - - @javascript - Scenario: I can preview with text - Given I write a comment like ":+1: Nice" - Then The comment preview tab should be display rendered Markdown - - @javascript - Scenario: I preview a comment - Given I preview a comment text like "Bug fixed :smile:" - Then I should see the comment preview - And I should not see the comment text field - - @javascript - Scenario: I can edit after preview - Given I preview a comment text like "Bug fixed :smile:" - Then I should see the comment write tab - - @javascript - Scenario: I have a reset form after posting from preview - Given I preview a comment text like "Bug fixed :smile:" - And I submit the comment - Then I should see an empty comment text field - And I should not see the comment preview - - @javascript - Scenario: I can delete a comment - Given I leave a comment like "XML attached" - And I delete a comment - Then I should not see a comment saying "XML attached" - - @javascript - Scenario: I can edit a comment with +1 - Given I leave a comment like "XML attached" - And I edit the last comment with a +1 - Then I should see +1 in the description diff --git a/features/project/commits/commits.feature b/features/project/commits/commits.feature deleted file mode 100644 index c4b206edc95..00000000000 --- a/features/project/commits/commits.feature +++ /dev/null @@ -1,47 +0,0 @@ -Feature: Project Commits - Background: - Given I sign in as a user - And I own a project - And I visit my project's commits page - - Scenario: I browse commits list for master branch - Then I see project commits - - Scenario: I browse atom feed of commits list for master branch - Given I click atom feed link - Then I see commits atom feed - - Scenario: I browse commit from list - Given I click on commit link - Then I see commit info - And I see side-by-side diff button - - Scenario: I browse commit with side-by-side diff view - Given I click on commit link - And I click side-by-side diff button - Then I see inline diff button - - @javascript - Scenario: I compare refs - Given I visit compare refs page - And I fill compare fields with refs - Then I see compared refs - And I unfold diff - Then I should see additional file lines - - Scenario: I browse commits for a specific path - Given I visit my project's commits page for a specific path - Then I see breadcrumb links - - # TODO: Implement feature in graphs - #Scenario: I browse commits stats - #Given I visit my project's commits stats page - #Then I see commits stats - - Scenario: I browse big commit - Given I visit big commit page - Then I see big commit warning - - Scenario: I browse a commit with an image - Given I visit a commit with an image that changed - Then The diff links to both the previous and current image diff --git a/features/project/commits/diff_comments.feature b/features/project/commits/diff_comments.feature deleted file mode 100644 index 56b9a13678d..00000000000 --- a/features/project/commits/diff_comments.feature +++ /dev/null @@ -1,79 +0,0 @@ -Feature: Project Commits Diff Comments - Background: - Given I sign in as a user - And I own project "Shop" - And I visit project commit page - - @javascript - Scenario: I can access add diff comment buttons - Then I should see add a diff comment button - - @javascript - Scenario: I can comment on a commit diff - Given I leave a diff comment like "Typo, please fix" - Then I should see a diff comment saying "Typo, please fix" - - @javascript - Scenario: I get a temporary form for the first comment on a diff line - Given I open a diff comment form - Then I should see a temporary diff comment form - - @javascript - Scenario: I have a cancel button on the diff form - Given I open a diff comment form - Then I should see the cancel comment button - - @javascript - Scenario: I can cancel a diff form - Given I open a diff comment form - And I cancel the diff comment - Then I should not see the diff comment form - - @javascript - Scenario: I can't open a second form for a diff line - Given I open a diff comment form - And I open a diff comment form - Then I should only see one diff form - - @javascript - Scenario: I can have multiple forms - Given I open a diff comment form - And I write a diff comment like ":-1: I don't like this" - And I open another diff comment form - Then I should see a diff comment form with ":-1: I don't like this" - And I should see an empty diff comment form - - @javascript - Scenario: I can preview multiple forms separately - Given I preview a diff comment text like "Should fix it :smile:" - And I preview another diff comment text like "DRY this up" - Then I should see two separate previews - - @javascript - Scenario: I have a reply button in discussions - Given I leave a diff comment like "Typo, please fix" - Then I should see a discussion reply button - - @javascript - Scenario: I can preview with text - Given I open a diff comment form - And I write a diff comment like ":-1: I don't like this" - Then The diff comment preview tab should display rendered Markdown - - @javascript - Scenario: I preview a diff comment - Given I preview a diff comment text like "Should fix it :smile:" - Then I should see the diff comment preview - And I should not see the diff comment text field - - @javascript - Scenario: I can edit after preview - Given I preview a diff comment text like "Should fix it :smile:" - Then I should see the diff comment write tab - - @javascript - Scenario: The form gets removed after posting - Given I preview a diff comment text like "Should fix it :smile:" - And I submit the diff comment - Then I should not see the diff comment form - And I should see a discussion reply button diff --git a/features/project/commits/tags.feature b/features/project/commits/tags.feature deleted file mode 100644 index 02f399f7cad..00000000000 --- a/features/project/commits/tags.feature +++ /dev/null @@ -1,41 +0,0 @@ -Feature: Project Commits Tags - Background: - Given I sign in as a user - And I own project "Shop" - Given I visit project tags page - - Scenario: I can see all git tags - Then I should see "Shop" all tags list - - Scenario: I create a tag - And I click new tag link - And I submit new tag form - Then I should see new tag created - - Scenario: I create a tag with invalid name - And I click new tag link - And I submit new tag form with invalid name - Then I should see new an error that tag is invalid - - Scenario: I create a tag with invalid reference - And I click new tag link - And I submit new tag form with invalid reference - Then I should see new an error that tag ref is invalid - - Scenario: I create a tag that already exists - And I click new tag link - And I submit new tag form with tag that already exists - Then I should see new an error that tag already exists - - @javascript - Scenario: I delete a tag - Given I delete tag 'v1.1.0' - Then I should not see tag 'v1.1.0' - - @javascript - Scenario: I delete all tags and see info message - Given I delete all tags - Then I should see tags info message - - # @wip - # Scenario: I can download project by tag diff --git a/features/project/commits/user_lookup.feature b/features/project/commits/user_lookup.feature deleted file mode 100644 index db51d4a6cfa..00000000000 --- a/features/project/commits/user_lookup.feature +++ /dev/null @@ -1,15 +0,0 @@ -Feature: Project Commits User Lookup - Background: - Given I sign in as a user - And I own a project - And I visit my project's commits page - - Scenario: I browse commit from list - Given I have user with primary email - When I click on commit link - Then I see author based on primary email - - Scenario: I browse another commit from list - Given I have user with secondary email - When I click on another commit link - Then I see author based on secondary email diff --git a/features/project/create.feature b/features/project/create.feature deleted file mode 100644 index e9dc4fe6b3c..00000000000 --- a/features/project/create.feature +++ /dev/null @@ -1,23 +0,0 @@ -Feature: Project Create - In order to get access to project sections - A user with ability to create a project - Should be able to create a new one - - @javascript - Scenario: User create a project - Given I sign in as a user - When I visit new project page - And fill project form with valid data - Then I should see project page - And I should see empty project instuctions - - @javascript - Scenario: Empty project instructions - Given I sign in as a user - When I visit new project page - And fill project form with valid data - Then I see empty project instuctions - And I click on HTTP - Then Remote url should update to http link - And If I click on SSH - Then Remote url should update to ssh link diff --git a/features/project/deploy_keys.feature b/features/project/deploy_keys.feature deleted file mode 100644 index a71f6124d9c..00000000000 --- a/features/project/deploy_keys.feature +++ /dev/null @@ -1,40 +0,0 @@ -Feature: Project Deploy Keys - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I should see deploy keys list - Given project has deploy key - When I visit project deploy keys page - Then I should see project deploy key - - Scenario: I should see project deploy keys - Given other project has deploy key - When I visit project deploy keys page - Then I should see other project deploy key - - Scenario: I should see public deploy keys - Given public deploy key exists - When I visit project deploy keys page - Then I should see public deploy key - - Scenario: I add new deploy key - Given I visit project deploy keys page - When I click 'New Deploy Key' - And I submit new deploy key - Then I should be on deploy keys page - And I should see newly created deploy key - - Scenario: I attach other project deploy key to project - Given other project has deploy key - And I visit project deploy keys page - When I click attach deploy key - Then I should be on deploy keys page - And I should see newly created deploy key - - Scenario: I attach public deploy key to project - Given public deploy key exists - And I visit project deploy keys page - When I click attach deploy key - Then I should be on deploy keys page - And I should see newly created deploy key diff --git a/features/project/fork.feature b/features/project/fork.feature deleted file mode 100644 index 22f68e5b340..00000000000 --- a/features/project/fork.feature +++ /dev/null @@ -1,16 +0,0 @@ -Feature: Project Fork - Background: - Given I sign in as a user - And I am a member of project "Shop" - When I visit project "Shop" page - - Scenario: User fork a project - Given I click link "Fork" - When I fork to my namespace - Then I should see the forked project page - - Scenario: User already has forked the project - Given I already have a project named "Shop" in my namespace - And I click link "Fork" - When I fork to my namespace - Then I should see a "Name has already been taken" warning diff --git a/features/project/forked_merge_requests.feature b/features/project/forked_merge_requests.feature deleted file mode 100644 index d9fbb875c28..00000000000 --- a/features/project/forked_merge_requests.feature +++ /dev/null @@ -1,40 +0,0 @@ -Feature: Project Forked Merge Requests - Background: - Given I sign in as a user - And I am a member of project "Shop" - And I have a project forked off of "Shop" called "Forked Shop" - - Scenario: I submit new unassigned merge request to a forked project - Given I visit project "Forked Shop" merge requests page - And I click link "New Merge Request" - And I fill out a "Merge Request On Forked Project" merge request - And I submit the merge request - Then I should see merge request "Merge Request On Forked Project" - - # TODO: Improve it so it does not fail randomly - # - #@javascript - #Scenario: I can edit a forked merge request - #Given I visit project "Forked Shop" merge requests page - #And I click link "New Merge Request" - #And I fill out a "Merge Request On Forked Project" merge request - #And I submit the merge request - #And I should see merge request "Merge Request On Forked Project" - #And I click link edit "Merge Request On Forked Project" - #Then I see the edit page prefilled for "Merge Request On Forked Project" - #And I update the merge request title - #And I save the merge request - #Then I should see the edited merge request - - @javascript - Scenario: I cannot submit an invalid merge request - Given I visit project "Forked Shop" merge requests page - And I click link "New Merge Request" - And I fill out an invalid "Merge Request On Forked Project" merge request - Then I should see validation errors - - @javascript - Scenario: Merge request should target fork repository by default - Given I visit project "Forked Shop" merge requests page - And I click link "New Merge Request" - Then the target repository should be the original repository diff --git a/features/project/graph.feature b/features/project/graph.feature deleted file mode 100644 index 89064242c1c..00000000000 --- a/features/project/graph.feature +++ /dev/null @@ -1,14 +0,0 @@ -Feature: Project Graph - Background: - Given I sign in as a user - And I own project "Shop" - - @javascript - Scenario: I should see project graphs - When I visit project "Shop" graph page - Then page should have graphs - - @javascript - Scenario: I should see project commits graphs - When I visit project "Shop" commits graph page - Then page should have commits graphs diff --git a/features/project/hooks.feature b/features/project/hooks.feature deleted file mode 100644 index 1a60846a23e..00000000000 --- a/features/project/hooks.feature +++ /dev/null @@ -1,32 +0,0 @@ -Feature: Project Hooks - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I should see hook list - Given project has hook - When I visit project hooks page - Then I should see project hook - - Scenario: I add new hook - Given I visit project hooks page - When I submit new hook - Then I should see newly created hook - - Scenario: I test hook - Given project has hook - And I visit project hooks page - When I click test hook button - Then hook should be triggered - - Scenario: I test a hook on empty project - Given I own empty project with hook - And I visit project hooks page - When I click test hook button - Then I should see hook error message - - Scenario: I test a hook on down URL - Given project has hook - And I visit project hooks page - When I click test hook button with invalid URL - Then I should see hook service down error message diff --git a/features/project/issues/filter_labels.feature b/features/project/issues/filter_labels.feature deleted file mode 100644 index e316f519861..00000000000 --- a/features/project/issues/filter_labels.feature +++ /dev/null @@ -1,26 +0,0 @@ -Feature: Project Issues Filter Labels - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has labels: "bug", "feature", "enhancement" - And project "Shop" has issue "Bugfix1" with labels: "bug", "feature" - And project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement" - And project "Shop" has issue "Feature1" with labels: "feature" - Given I visit project "Shop" issues page - - @javascript - Scenario: I filter by one label - Given I click link "bug" - Then I should see "Bugfix1" in issues list - And I should see "Bugfix2" in issues list - And I should not see "Feature1" in issues list - - # TODO: make labels filter works according to this scanario - # right now it looks for label 1 OR label 2. Old behaviour (this test) was - # all issues that have both label 1 AND label 2 - #Scenario: I filter by two labels - #Given I click link "bug" - #And I click link "feature" - #Then I should see "Bugfix1" in issues list - #And I should not see "Bugfix2" in issues list - #And I should not see "Feature1" in issues list diff --git a/features/project/issues/issues.feature b/features/project/issues/issues.feature deleted file mode 100644 index eb813884d1e..00000000000 --- a/features/project/issues/issues.feature +++ /dev/null @@ -1,219 +0,0 @@ -Feature: Project Issues - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" have "Release 0.4" open issue - And project "Shop" have "Tweet control" open issue - And project "Shop" have "Release 0.3" closed issue - And I visit project "Shop" issues page - - Scenario: I should see open issues - Given I should see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - - Scenario: I should see closed issues - Given I click link "Closed" - Then I should see "Release 0.3" in issues - And I should not see "Release 0.4" in issues - - Scenario: I should see all issues - Given I click link "All" - Then I should see "Release 0.3" in issues - And I should see "Release 0.4" in issues - - Scenario: I visit issue page - Given I click link "Release 0.4" - Then I should see issue "Release 0.4" - - @javascript - Scenario: I visit issue page - Given I add a user to project "Shop" - And I click "author" dropdown - Then I see current user as the first user - - Scenario: I submit new unassigned issue - Given I click link "New Issue" - And I submit new issue "500 error on profile" - Then I should see issue "500 error on profile" - - Scenario: I submit new unassigned issue with labels - Given project "Shop" has labels: "bug", "feature", "enhancement" - And I click link "New Issue" - And I submit new issue "500 error on profile" with label 'bug' - Then I should see issue "500 error on profile" - And I should see label 'bug' with issue - - @javascript - Scenario: I comment issue - Given I visit issue page "Release 0.4" - And I leave a comment like "XML attached" - Then I should see comment "XML attached" - And I should see an error alert section within the comment form - - @javascript - Scenario: I search issue - Given I fill in issue search with "Re" - Then I should see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - @javascript - Scenario: I search issue that not exist - Given I fill in issue search with "Bu" - Then I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - - @javascript - Scenario: I search all issues - Given I click link "All" - And I fill in issue search with ".3" - Then I should see "Release 0.3" in issues - And I should not see "Release 0.4" in issues - - @javascript - Scenario: Search issues when search string exactly matches issue description - Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1' - And I fill in issue search with 'Description for issue1' - Then I should see 'Bugfix1' in issues - And I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - @javascript - Scenario: Search issues when search string partially matches issue description - Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1' - And project 'Shop' has issue 'Feature1' with description: 'Feature submitted for issue1' - And I fill in issue search with 'issue1' - Then I should see 'Feature1' in issues - Then I should see 'Bugfix1' in issues - And I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - @javascript - Scenario: Search issues when search string matches no issue description - Given project 'Shop' has issue 'Bugfix1' with description: 'Description for issue1' - And I fill in issue search with 'Rock and roll' - Then I should not see 'Bugfix1' in issues - And I should not see "Release 0.4" in issues - And I should not see "Release 0.3" in issues - And I should not see "Tweet control" in issues - - - # Markdown - - Scenario: Headers inside the description should have ids generated for them. - Given I visit issue page "Release 0.4" - Then Header "Description header" should have correct id and link - - @javascript - Scenario: Headers inside comments should not have ids generated for them. - Given I visit issue page "Release 0.4" - And I leave a comment with a header containing "Comment with a header" - Then The comment with the header should not have an ID - - @javascript - Scenario: Blocks inside comments should not build relative links - Given I visit issue page "Release 0.4" - And I leave a comment with code block - Then The code block should be unchanged - - Scenario: Issues on empty project - Given empty project "Empty Project" - When I visit empty project page - And I see empty project details with ssh clone info - When I visit empty project's issues page - Given I click link "New Issue" - And I submit new issue "500 error on profile" - Then I should see issue "500 error on profile" - - Scenario: Clickable labels - Given issue 'Release 0.4' has label 'bug' - And I visit project "Shop" issues page - When I click label 'bug' - And I should see "Release 0.4" in issues - And I should not see "Tweet control" in issues - - Scenario: Issue description should render task checkboxes - Given project "Shop" has "Tasks-open" open issue with task markdown - When I visit issue page "Tasks-open" - Then I should see task checkboxes in the description - - @javascript - Scenario: Issue notes should not render task checkboxes - Given project "Shop" has "Tasks-open" open issue with task markdown - When I visit issue page "Tasks-open" - And I leave a comment with task markdown - Then I should not see task checkboxes in the comment - - @javascript - Scenario: Issue notes should be editable with +1 - Given project "Shop" has "Tasks-open" open issue with task markdown - When I visit issue page "Tasks-open" - And I leave a comment with a header containing "Comment with a header" - Then The comment with the header should not have an ID - And I edit the last comment with a +1 - Then I should see +1 in the description - - # Task status in issues list - - Scenario: Issues list should display task status - Given project "Shop" has "Tasks-open" open issue with task markdown - When I visit project "Shop" issues page - Then I should see the task status for the Taskable - - # Toggling task items - - @javascript - Scenario: Task checkboxes should be enabled for an open issue - Given project "Shop" has "Tasks-open" open issue with task markdown - When I visit issue page "Tasks-open" - Then Task checkboxes should be enabled - - @javascript - Scenario: Task checkboxes should be disabled for a closed issue - Given project "Shop" has "Tasks-closed" closed issue with task markdown - When I visit issue page "Tasks-closed" - Then Task checkboxes should be disabled - - # Issue description preview - - @javascript - Scenario: I can't preview without text - Given I click link "New Issue" - And I haven't written any description text - Then The Markdown preview tab should say there is nothing to do - - @javascript - Scenario: I can preview with text - Given I click link "New Issue" - And I write a description like ":+1: Nice" - Then The Markdown preview tab should display rendered Markdown - - @javascript - Scenario: I preview an issue description - Given I click link "New Issue" - And I preview a description text like "Bug fixed :smile:" - Then I should see the Markdown preview - And I should not see the Markdown text field - - @javascript - Scenario: I can edit after preview - Given I click link "New Issue" - And I preview a description text like "Bug fixed :smile:" - Then I should see the Markdown write tab - - @javascript - Scenario: I can preview when editing an existing issue - Given I click link "Release 0.4" - And I click link "Edit" for the issue - And I preview a description text like "Bug fixed :smile:" - Then I should see the Markdown write tab - - @javascript - Scenario: I can unsubscribe from issue - Given project "Shop" has "Tasks-open" open issue with task markdown - When I visit issue page "Tasks-open" - Then I should see that I am subscribed - When I click button "Unsubscribe" - Then I should see that I am unsubscribed diff --git a/features/project/issues/labels.feature b/features/project/issues/labels.feature deleted file mode 100644 index 039a7d83cb1..00000000000 --- a/features/project/issues/labels.feature +++ /dev/null @@ -1,47 +0,0 @@ -Feature: Project Issues Labels - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has labels: "bug", "feature", "enhancement" - Given I visit project "Shop" labels page - - Scenario: I should see labels list - Then I should see label 'bug' - And I should see label 'feature' - - Scenario: I create new label - Given I visit project "Shop" new label page - When I submit new label 'support' - Then I should see label 'support' - - Scenario: I edit label - Given I visit 'bug' label edit page - When I change label 'bug' to 'fix' - Then I should not see label 'bug' - Then I should see label 'fix' - - Scenario: I remove label - When I remove label 'bug' - Then I should not see label 'bug' - - @javascript - Scenario: I remove all labels - When I delete all labels - Then I should see labels help message - - Scenario: I create a label with invalid color - Given I visit project "Shop" new label page - When I submit new label with invalid color - Then I should see label color error message - - Scenario: I create a label that already exists - Given I visit project "Shop" new label page - When I submit new label 'bug' - Then I should see label label exist error message - - Scenario: I create the same label on another project - Given I own project "Forum" - And I visit project "Forum" labels page - And I visit project "Forum" new label page - When I submit new label 'bug' - Then I should see label 'bug' diff --git a/features/project/issues/milestones.feature b/features/project/issues/milestones.feature deleted file mode 100644 index 9ac65b1257c..00000000000 --- a/features/project/issues/milestones.feature +++ /dev/null @@ -1,30 +0,0 @@ -Feature: Project Issues Milestones - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has milestone "v2.2" - Given I visit project "Shop" milestones page - - Scenario: I should see active milestones - Then I should see milestone "v2.2" - - Scenario: I should see milestone - Given I click link "v2.2" - Then I should see milestone "v2.2" - - Scenario: I create new milestone - Given I click link "New Milestone" - And I submit new milestone "v2.3" - Then I should see milestone "v2.3" - - @javascript - Scenario: Listing closed issues - Given the milestone has open and closed issues - And I click link "v2.2" - Then I should see 3 issues - - # Markdown - - Scenario: Headers inside the description should have ids generated for them. - Given I click link "v2.2" - Then Header "Description header" should have correct id and link diff --git a/features/project/merge_requests.feature b/features/project/merge_requests.feature deleted file mode 100644 index cbb5c8eb39b..00000000000 --- a/features/project/merge_requests.feature +++ /dev/null @@ -1,241 +0,0 @@ -Feature: Project Merge Requests - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" have "Bug NS-04" open merge request - And project "Shop" have "Feature NS-03" closed merge request - And I visit project "Shop" merge requests page - - Scenario: I should see open merge requests - Then I should see "Bug NS-04" in merge requests - And I should not see "Feature NS-03" in merge requests - - Scenario: I should see closed merge requests - Given I click link "Closed" - Then I should see "Feature NS-03" in merge requests - And I should not see "Bug NS-04" in merge requests - - Scenario: I should see all merge requests - Given I click link "All" - Then I should see "Feature NS-03" in merge requests - And I should see "Bug NS-04" in merge requests - - Scenario: I visit merge request page - Given I click link "Bug NS-04" - Then I should see merge request "Bug NS-04" - - Scenario: I close merge request page - Given I click link "Bug NS-04" - And I click link "Close" - Then I should see closed merge request "Bug NS-04" - - Scenario: I reopen merge request page - Given I click link "Bug NS-04" - And I click link "Close" - Then I should see closed merge request "Bug NS-04" - When I click link "Reopen" - Then I should see reopened merge request "Bug NS-04" - - Scenario: I submit new unassigned merge request - Given I click link "New Merge Request" - And I submit new merge request "Wiki Feature" - Then I should see merge request "Wiki Feature" - - @javascript - Scenario: I comment on a merge request - Given I visit merge request page "Bug NS-04" - And I leave a comment like "XML attached" - Then I should see comment "XML attached" - - @javascript - Scenario: I comment on a merge request diff - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I leave a comment like "Line is wrong" on diff - And I switch to the merge request's comments tab - Then I should see a discussion has started on diff - - @javascript - Scenario: I comment on a line of a commit in merge request - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I click on the commit in the merge request - And I leave a comment like "Line is wrong" on diff in commit - And I switch to the merge request's comments tab - Then I should see a discussion has started on commit diff - - @javascript - Scenario: I comment on a commit in merge request - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I click on the commit in the merge request - And I leave a comment on the diff page in commit - And I switch to the merge request's comments tab - Then I should see a discussion has started on commit - - @javascript - Scenario: I accept merge request with custom commit message - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And merge request "Bug NS-05" is mergeable - And I visit merge request page "Bug NS-05" - And merge request is mergeable - Then I modify merge commit message - And I accept this merge request - Then I should see merged request - - # Markdown - - Scenario: Headers inside the description should have ids generated for them. - When I visit merge request page "Bug NS-04" - Then Header "Description header" should have correct id and link - - @javascript - Scenario: Headers inside comments should not have ids generated for them. - Given I visit merge request page "Bug NS-04" - And I leave a comment with a header containing "Comment with a header" - Then The comment with the header should not have an ID - - Scenario: Merge request description should render task checkboxes - Given project "Shop" has "MR-task-open" open MR with task markdown - When I visit merge request page "MR-task-open" - Then I should see task checkboxes in the description - - Scenario: Merge request notes should not render task checkboxes - Given project "Shop" has "MR-task-open" open MR with task markdown - When I visit merge request page "MR-task-open" - Then I should not see task checkboxes in the comment - - # Toggling inline comments - - @javascript - Scenario: I hide comments on a merge request diff with comments in a single file - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I leave a comment like "Line is wrong" on line 39 of the second file - And I click link "Hide inline discussion" of the second file - Then I should not see a comment like "Line is wrong here" in the second file - - @javascript - Scenario: I show comments on a merge request diff with comments in a single file - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I leave a comment like "Line is wrong" on line 39 of the second file - Then I should see a comment like "Line is wrong" in the second file - - @javascript - Scenario: I hide comments on a merge request diff with comments in multiple files - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I leave a comment like "Line is correct" on line 12 of the first file - And I leave a comment like "Line is wrong" on line 39 of the second file - And I click link "Hide inline discussion" of the second file - Then I should not see a comment like "Line is wrong here" in the second file - And I should still see a comment like "Line is correct" in the first file - - @javascript - Scenario: I show comments on a merge request diff with comments in multiple files - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I leave a comment like "Line is correct" on line 12 of the first file - And I leave a comment like "Line is wrong" on line 39 of the second file - And I click link "Hide inline discussion" of the second file - And I click link "Show inline discussion" of the second file - Then I should see a comment like "Line is wrong" in the second file - And I should still see a comment like "Line is correct" in the first file - - @javascript - Scenario: I unfold diff - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I unfold diff - Then I should see additional file lines - - @javascript - Scenario: I show comments on a merge request side-by-side diff with comments in multiple files - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I switch to the diff tab - And I leave a comment like "Line is correct" on line 12 of the first file - And I leave a comment like "Line is wrong" on line 39 of the second file - And I click Side-by-side Diff tab - Then I should see comments on the side-by-side diff page - - @javascript - Scenario: I view diffs on a merge request - Given project "Shop" have "Bug NS-05" open merge request with diffs inside - And I visit merge request page "Bug NS-05" - And I click on the Changes tab via Javascript - Then I should see the proper Inline and Side-by-side links - - # Task status in issues list - - Scenario: Merge requests list should display task status - Given project "Shop" has "MR-task-open" open MR with task markdown - When I visit project "Shop" merge requests page - Then I should see the task status for the Taskable - - # Toggling task items - - @javascript - Scenario: Task checkboxes should be enabled for an open merge request - Given project "Shop" has "MR-task-open" open MR with task markdown - When I visit merge request page "MR-task-open" - Then Task checkboxes should be enabled - - @javascript - Scenario: Task checkboxes should be disabled for a closed merge request - Given project "Shop" has "MR-task-open" open MR with task markdown - And I visit merge request page "MR-task-open" - And I click link "Close" - Then Task checkboxes should be disabled - - # Description preview - - @javascript - Scenario: I can't preview without text - Given I visit merge request page "Bug NS-04" - And I click link "Edit" for the merge request - And I haven't written any description text - Then The Markdown preview tab should say there is nothing to do - - @javascript - Scenario: I can preview with text - Given I visit merge request page "Bug NS-04" - And I click link "Edit" for the merge request - And I write a description like ":+1: Nice" - Then The Markdown preview tab should display rendered Markdown - - @javascript - Scenario: I preview a merge request description - Given I visit merge request page "Bug NS-04" - And I click link "Edit" for the merge request - And I preview a description text like "Bug fixed :smile:" - Then I should see the Markdown preview - And I should not see the Markdown text field - - @javascript - Scenario: I can edit after preview - Given I visit merge request page "Bug NS-04" - And I click link "Edit" for the merge request - And I preview a description text like "Bug fixed :smile:" - Then I should see the Markdown write tab - - @javascript - Scenario: I search merge request - Given I click link "All" - When I fill in merge request search with "Fe" - Then I should see "Feature NS-03" in merge requests - And I should not see "Bug NS-04" in merge requests - - @javascript - Scenario: I can unsubscribe from merge request - Given I visit merge request page "Bug NS-04" - Then I should see that I am subscribed - When I click button "Unsubscribe" - Then I should see that I am unsubscribed diff --git a/features/project/network_graph.feature b/features/project/network_graph.feature deleted file mode 100644 index 8beb6043aff..00000000000 --- a/features/project/network_graph.feature +++ /dev/null @@ -1,40 +0,0 @@ -Feature: Project Network Graph - Background: - Given I sign in as a user - And I own project "Shop" - And I visit project "Shop" network page - - @javascript - Scenario: I should see project network - Then page should have network graph - And page should select "master" in select box - And page should have "master" on graph - - @javascript - Scenario: I should switch "branch" and "tag" - When I switch ref to "feature" - Then page should select "feature" in select box - And page should have "feature" on graph - When I switch ref to "v1.0.0" - Then page should select "v1.0.0" in select box - And page should have "v1.0.0" on graph - - @javascript - Scenario: I should looking for a commit by SHA - When I looking for a commit by SHA of "v1.0.0" - Then page should have network graph - And page should select "master" in select box - And page should have "v1.0.0" on graph - - @javascript - Scenario: I should filter selected tag - When I switch ref to "v1.0.0" - Then page should have content not containing "v1.0.0" - When click "Show only selected branch" checkbox - Then page should not have content not containing "v1.0.0" - When click "Show only selected branch" checkbox - Then page should have content not containing "v1.0.0" - - Scenario: I should fail to look for a commit - When I look for a commit by ";" - Then page status code should be 404 diff --git a/features/project/project.feature b/features/project/project.feature deleted file mode 100644 index 3e1fd54bee8..00000000000 --- a/features/project/project.feature +++ /dev/null @@ -1,57 +0,0 @@ -Feature: Project - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" has push event - And I visit project "Shop" page - - Scenario: I edit the project avatar - Given I visit edit project "Shop" page - When I change the project avatar - And I should see new project avatar - And I should see the "Remove avatar" button - - Scenario: I remove the project avatar - Given I visit edit project "Shop" page - And I have an project avatar - When I remove my project avatar - Then I should see the default project avatar - And I should not see the "Remove avatar" button - - @javascript - Scenario: I should see project activity - When I visit project "Shop" page - Then I should see project "Shop" activity feed - - Scenario: I visit edit project - When I visit edit project "Shop" page - Then I should see project settings - - Scenario: I edit project - When I visit edit project "Shop" page - And change project settings - And I save project - Then I should see project with new settings - - Scenario: I change project path - When I visit edit project "Shop" page - And change project path settings - Then I should see project with new path settings - - Scenario: I should see project readme and version - When I visit project "Shop" page - And I should see project "Shop" version - - Scenario: I should change project default branch - When I visit edit project "Shop" page - And change project default branch - And I save project - Then I should see project default branch changed - - @javascript - Scenario: I should have default tab per my preference - And I own project "Forum" - When I select project "Forum" README tab - Then I should see project "Forum" README - And I visit project "Shop" page - Then I should see project "Shop" README diff --git a/features/project/redirects.feature b/features/project/redirects.feature deleted file mode 100644 index a2e77e7bf30..00000000000 --- a/features/project/redirects.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Project Redirects - Background: - Given public project "Community" - And private project "Enterprise" - - Scenario: I visit public project page - When I visit project "Community" page - Then I should see project "Community" home page - - Scenario: I visit private project page - When I visit project "Enterprise" page - Then I should be redirected to sign in page - - Scenario: I visit a non-existent project page - When I visit project "CommunityDoesNotExist" page - Then I should be redirected to sign in page - - Scenario: I visit a non-existent project page as user - Given I sign in as a user - When I visit project "CommunityDoesNotExist" page - Then page status code should be 404 - - Scenario: I visit unauthorized project page as user - Given I sign in as a user - When I visit project "Enterprise" page - Then page status code should be 404 - - Scenario: I visit a public project without signing in - When I visit project "Community" page - And I should see project "Community" home page - And I click on "Sign In" - And Authenticate - Then I should be redirected to "Community" page - - Scenario: I visit private project page without signing in - When I visit project "Enterprise" page - And I get redirected to signin page where I sign in - Then I should be redirected to "Enterprise" page diff --git a/features/project/service.feature b/features/project/service.feature deleted file mode 100644 index fdff640ec85..00000000000 --- a/features/project/service.feature +++ /dev/null @@ -1,86 +0,0 @@ -Feature: Project Services - Background: - Given I sign in as a user - And I own project "Shop" - - Scenario: I should see project services - When I visit project "Shop" services page - Then I should see list of available services - - Scenario: Activate gitlab-ci service - When I visit project "Shop" services page - And I click gitlab-ci service link - And I fill gitlab-ci settings - Then I should see service settings saved - - Scenario: Activate hipchat service - When I visit project "Shop" services page - And I click hipchat service link - And I fill hipchat settings - Then I should see hipchat service settings saved - - Scenario: Activate hipchat service with custom server - When I visit project "Shop" services page - And I click hipchat service link - And I fill hipchat settings with custom server - Then I should see hipchat service settings with custom server saved - - Scenario: Activate pivotaltracker service - When I visit project "Shop" services page - And I click pivotaltracker service link - And I fill pivotaltracker settings - Then I should see pivotaltracker service settings saved - - Scenario: Activate Flowdock service - When I visit project "Shop" services page - And I click Flowdock service link - And I fill Flowdock settings - Then I should see Flowdock service settings saved - - Scenario: Activate Assembla service - When I visit project "Shop" services page - And I click Assembla service link - And I fill Assembla settings - Then I should see Assembla service settings saved - - Scenario: Activate Slack service - When I visit project "Shop" services page - And I click Slack service link - And I fill Slack settings - Then I should see Slack service settings saved - - Scenario: Activate Pushover service - When I visit project "Shop" services page - And I click Pushover service link - And I fill Pushover settings - Then I should see Pushover service settings saved - - Scenario: Activate email on push service - When I visit project "Shop" services page - And I click email on push service link - And I fill email on push settings - Then I should see email on push service settings saved - - Scenario: Activate Irker (IRC Gateway) service - When I visit project "Shop" services page - And I click Irker service link - And I fill Irker settings - Then I should see Irker service settings saved - - Scenario: Activate Atlassian Bamboo CI service - When I visit project "Shop" services page - And I click Atlassian Bamboo CI service link - And I fill Atlassian Bamboo CI settings - Then I should see Atlassian Bamboo CI service settings saved - - Scenario: Activate jetBrains TeamCity CI service - When I visit project "Shop" services page - And I click jetBrains TeamCity CI service link - And I fill jetBrains TeamCity CI settings - Then I should see jetBrains TeamCity CI service settings saved - - Scenario: Activate Asana service - When I visit project "Shop" services page - And I click Asana service link - And I fill Asana settings - Then I should see Asana service settings saved diff --git a/features/project/shortcuts.feature b/features/project/shortcuts.feature deleted file mode 100644 index cfb68bf1f50..00000000000 --- a/features/project/shortcuts.feature +++ /dev/null @@ -1,52 +0,0 @@ -@dashboard -Feature: Project Shortcuts - Background: - Given I sign in as a user - And I own a project - And I visit my project's home page - - @javascript - Scenario: Navigate to files tab - Given I press "g" and "f" - Then the active main tab should be Files - - @javascript - Scenario: Navigate to commits tab - Given I press "g" and "c" - Then the active main tab should be Commits - - @javascript - Scenario: Navigate to network tab - Given I press "g" and "n" - Then the active main tab should be Network - - @javascript - Scenario: Navigate to graphs tab - Given I press "g" and "g" - Then the active main tab should be Graphs - - @javascript - Scenario: Navigate to issues tab - Given I press "g" and "i" - Then the active main tab should be Issues - - @javascript - Scenario: Navigate to merge requests tab - Given I press "g" and "m" - Then the active main tab should be Merge Requests - - @javascript - Scenario: Navigate to snippets tab - Given I press "g" and "s" - Then the active main tab should be Snippets - - @javascript - Scenario: Navigate to wiki tab - Given I press "g" and "w" - Then the active main tab should be Wiki - - @javascript - Scenario: Navigate to project feed - Given I visit my project's files page - Given I press "g" and "p" - Then the active main tab should be Home diff --git a/features/project/snippets.feature b/features/project/snippets.feature deleted file mode 100644 index 77e42a1a38b..00000000000 --- a/features/project/snippets.feature +++ /dev/null @@ -1,34 +0,0 @@ -Feature: Project Snippets - Background: - Given I sign in as a user - And I own project "Shop" - And project "Shop" have "Snippet one" snippet - And project "Shop" have no "Snippet two" snippet - And I visit project "Shop" snippets page - - Scenario: I should see snippets - Given I visit project "Shop" snippets page - Then I should see "Snippet one" in snippets - And I should not see "Snippet two" in snippets - - Scenario: I create new project snippet - Given I click link "New Snippet" - And I submit new snippet "Snippet three" - Then I should see snippet "Snippet three" - - @javascript - Scenario: I comment on a snippet "Snippet one" - Given I visit snippet page "Snippet one" - And I leave a comment like "Good snippet!" - Then I should see comment "Good snippet!" - - Scenario: I update "Snippet one" - Given I visit snippet page "Snippet one" - And I click link "Edit" - And I submit new title "Snippet new title" - Then I should see "Snippet new title" - - Scenario: I destroy "Snippet one" - Given I visit snippet page "Snippet one" - And I click link "Remove Snippet" - Then I should not see "Snippet one" in snippets diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature deleted file mode 100644 index 90b966dd645..00000000000 --- a/features/project/source/browse_files.feature +++ /dev/null @@ -1,160 +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" - - 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 - - @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 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 file on new branch - And I should see its new content - - @javascript @tricky - Scenario: I can create file in empty repo - Given I own an empty project - And I visit my empty project page - And I create bare repo - When I click on "add a file" link - 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: 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 a commit error message - - @javascript - Scenario: I can edit file - Given I click on ".gitignore" file in repo - And I click button "Edit" - Then 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 - - Scenario: If I don't have edit permission the edit link is disabled - Given public project "Community" - And I visit project "Community" source page - And I click on ".gitignore" file in repo - Then The edit button is disabled - - @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 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 ".gitignore" on new branch - 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 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 remove file and commit - Given I click on ".gitignore" file in repo - And I see the ".gitignore" - And I click on "Remove" - And I fill the commit message - And I click on "Remove file" - Then I am redirected to the files URL - And I don't see the ".gitignore" - - 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 diff --git a/features/project/source/git_blame.feature b/features/project/source/git_blame.feature deleted file mode 100644 index 48b1077dc6b..00000000000 --- a/features/project/source/git_blame.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Project Source Git Blame - Background: - Given I sign in as a user - And I own project "Shop" - Given I visit project source page - - Scenario: I blame file - Given I click on ".gitignore" file in repo - And I click Blame button - Then I should see git file blame diff --git a/features/project/source/markdown_render.feature b/features/project/source/markdown_render.feature deleted file mode 100644 index ecbd721c281..00000000000 --- a/features/project/source/markdown_render.feature +++ /dev/null @@ -1,132 +0,0 @@ -Feature: Project Source Markdown Render - Background: - Given I sign in as a user - And I own project "Delta" - And I visit markdown branch - - # Tree README - - Scenario: Tree view should have correct links in README - Given I go directory which contains README file - And I click on a relative link in README - Then I should see the correct markdown - - Scenario: I browse files from markdown branch - Then I should see files from repository in markdown - And I should see rendered README which contains correct links - And I click on Gitlab API in README - Then I should see correct document rendered - - Scenario: I view README in markdown branch - Then I should see files from repository in markdown - And I should see rendered README which contains correct links - And I click on Rake tasks in README - Then I should see correct directory rendered - - Scenario: I view README in markdown branch to see reference links to directory - Then I should see files from repository in markdown - And I should see rendered README which contains correct links - And I click on GitLab API doc directory in README - Then I should see correct doc/api directory rendered - - Scenario: I view README in markdown branch to see reference links to file - Then I should see files from repository in markdown - And I should see rendered README which contains correct links - And I click on Maintenance in README - Then I should see correct maintenance file rendered - - Scenario: README headers should have header links - Then I should see rendered README which contains correct links - And Header "Application details" should have correct id and link - - # Blob - - Scenario: I navigate to doc directory to view documentation in markdown - And I navigate to the doc/api/README - And I see correct file rendered - And I click on users in doc/api/README - Then I should see the correct document file - - Scenario: I navigate to doc directory to view user doc in markdown - And I navigate to the doc/api/README - And I see correct file rendered - And I click on raketasks in doc/api/README - Then I should see correct directory rendered - - Scenario: I navigate to doc directory to view user doc in markdown - And I navigate to the doc/api/README - And Header "GitLab API" should have correct id and link - - # Markdown branch - - Scenario: I browse files from markdown branch - When I visit markdown branch - Then I should see files from repository in markdown branch - And I should see rendered README which contains correct links - And I click on Gitlab API in README - Then I should see correct document rendered for markdown branch - - Scenario: I browse directory from markdown branch - When I visit markdown branch - Then I should see files from repository in markdown branch - And I should see rendered README which contains correct links - And I click on Rake tasks in README - Then I should see correct directory rendered for markdown branch - - Scenario: I navigate to doc directory to view documentation in markdown branch - When I visit markdown branch - And I navigate to the doc/api/README - And I see correct file rendered in markdown branch - And I click on users in doc/api/README - Then I should see the users document file in markdown branch - - Scenario: I navigate to doc directory to view user doc in markdown branch - When I visit markdown branch - And I navigate to the doc/api/README - And I see correct file rendered in markdown branch - And I click on raketasks in doc/api/README - Then I should see correct directory rendered for markdown branch - - Scenario: Tree markdown links view empty urls should have correct urls - When I visit markdown branch - Then The link with text "empty" should have url "tree/markdown" - When I visit markdown branch "README.md" blob - Then The link with text "empty" should have url "blob/markdown/README.md" - When I visit markdown branch "d" tree - Then The link with text "empty" should have url "tree/markdown/d" - When I visit markdown branch "d/README.md" blob - Then The link with text "empty" should have url "blob/markdown/d/README.md" - - # "ID" means "#id" on the tests below, because we are unable to escape the hash sign. - # which Spinach interprets as the start of a comment. - Scenario: All markdown links with ids should have correct urls - When I visit markdown branch - Then The link with text "ID" should have url "tree/markdownID" - Then The link with text "/ID" should have url "tree/markdownID" - Then The link with text "README.mdID" should have url "blob/markdown/README.mdID" - Then The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID" - When I visit markdown branch "README.md" blob - Then The link with text "ID" should have url "blob/markdown/README.mdID" - Then The link with text "/ID" should have url "blob/markdown/README.mdID" - Then The link with text "README.mdID" should have url "blob/markdown/README.mdID" - Then The link with text "d/README.mdID" should have url "blob/markdown/d/README.mdID" - - # Wiki - - Scenario: I create a wiki page with different links - Given I go to wiki page - And I add various links to the wiki page - Then Wiki page should have added links - And I click on test link - Then I see new wiki page named test - When I go back to wiki page home - And I click on GitLab API doc link - Then I see Gitlab API document - When I go back to wiki page home - And I click on Rake tasks link - Then I see Rake tasks directory - - Scenario: Wiki headers should have should have ids generated for them. - Given I go to wiki page - And I add a header to the wiki page - Then Wiki header should have correct id and link diff --git a/features/project/source/multiselect_blob.feature b/features/project/source/multiselect_blob.feature deleted file mode 100644 index 63b7cb77a93..00000000000 --- a/features/project/source/multiselect_blob.feature +++ /dev/null @@ -1,85 +0,0 @@ -Feature: Project Source Multiselect Blob - Background: - Given I sign in as a user - And I own project "Shop" - And I visit ".gitignore" file in repo - - @javascript - Scenario: I click line 1 in file - When I click line 1 in file - Then I should see "L1" as URI fragment - And I should see line 1 highlighted - - @javascript - Scenario: I shift-click line 1 in file - When I shift-click line 1 in file - Then I should see "L1" as URI fragment - And I should see line 1 highlighted - - @javascript - Scenario: I click line 1 then click line 2 in file - When I click line 1 in file - Then I should see "L1" as URI fragment - And I should see line 1 highlighted - Then I click line 2 in file - Then I should see "L2" as URI fragment - And I should see line 2 highlighted - - @javascript - Scenario: I click various line numbers to test multiselect - Then I click line 1 in file - Then I should see "L1" as URI fragment - And I should see line 1 highlighted - Then I shift-click line 2 in file - Then I should see "L1-2" as URI fragment - And I should see lines 1-2 highlighted - Then I shift-click line 3 in file - Then I should see "L1-3" as URI fragment - And I should see lines 1-3 highlighted - Then I click line 3 in file - Then I should see "L3" as URI fragment - And I should see line 3 highlighted - Then I shift-click line 1 in file - Then I should see "L1-3" as URI fragment - And I should see lines 1-3 highlighted - Then I shift-click line 5 in file - Then I should see "L1-5" as URI fragment - And I should see lines 1-5 highlighted - Then I shift-click line 4 in file - Then I should see "L1-4" as URI fragment - And I should see lines 1-4 highlighted - Then I click line 5 in file - Then I should see "L5" as URI fragment - And I should see line 5 highlighted - Then I shift-click line 3 in file - Then I should see "L3-5" as URI fragment - And I should see lines 3-5 highlighted - Then I shift-click line 1 in file - Then I should see "L1-3" as URI fragment - And I should see lines 1-3 highlighted - Then I shift-click line 1 in file - Then I should see "L1" as URI fragment - And I should see line 1 highlighted - - @javascript - Scenario: I multiselect lines 1-5 and then go back and forward in history - When I click line 1 in file - And I shift-click line 3 in file - And I shift-click line 2 in file - And I shift-click line 5 in file - Then I should see "L1-5" as URI fragment - And I should see lines 1-5 highlighted - Then I go back in history - Then I should see "L1-2" as URI fragment - And I should see lines 1-2 highlighted - Then I go back in history - Then I should see "L1-3" as URI fragment - And I should see lines 1-3 highlighted - Then I go back in history - Then I should see "L1" as URI fragment - And I should see line 1 highlighted - Then I go forward in history - And I go forward in history - And I go forward in history - Then I should see "L1-5" as URI fragment - And I should see lines 1-5 highlighted diff --git a/features/project/source/search_code.feature b/features/project/source/search_code.feature deleted file mode 100644 index 4f9dcea249f..00000000000 --- a/features/project/source/search_code.feature +++ /dev/null @@ -1,15 +0,0 @@ -Feature: Project Source Search Code - Background: - Given I sign in as a user - - Scenario: Search for term "coffee" - Given I own project "Shop" - And I visit project source page - When I search for term "coffee" - Then I should see files from repository containing "coffee" - - Scenario: Search on empty project - Given I own an empty project - And I visit my project's home page - When I search for term "coffee" - Then I should see empty result diff --git a/features/project/star.feature b/features/project/star.feature deleted file mode 100644 index a45f9c470ea..00000000000 --- a/features/project/star.feature +++ /dev/null @@ -1,38 +0,0 @@ -Feature: Project Star - Scenario: New projects have 0 stars - Given public project "Community" - When I visit project "Community" page - Then The project has no stars - - Scenario: Empty projects show star count - Given public empty project "Empty Public Project" - When I visit empty project page - Then The project has no stars - - Scenario: Signed off users can't star projects - Given public project "Community" - And I visit project "Community" page - When I click on the star toggle button - Then I redirected to sign in page - - @javascript - Scenario: Signed in users can toggle star - Given I sign in as "John Doe" - And public project "Community" - And I visit project "Community" page - When I click on the star toggle button - Then The project has 1 star - When I click on the star toggle button - Then The project has 0 stars - - @javascript - Scenario: Star count sums stars - Given I sign in as "John Doe" - And public project "Community" - And I visit project "Community" page - And I click on the star toggle button - And I logout - And I sign in as "Mary Jane" - And I visit project "Community" page - When I click on the star toggle button - Then The project has 2 stars diff --git a/features/project/team_management.feature b/features/project/team_management.feature deleted file mode 100644 index 6cda225ea7b..00000000000 --- a/features/project/team_management.feature +++ /dev/null @@ -1,43 +0,0 @@ -Feature: Project Team Management - Background: - Given I sign in as a user - And I own project "Shop" - And gitlab user "Mike" - And gitlab user "Sam" - And "Sam" is "Shop" developer - And I visit project "Shop" team page - - Scenario: See all team members - Then I should be able to see myself in team - And I should see "Sam" in team list - - @javascript - Scenario: Add user to project - Given I click link "Add members" - And I select "Mike" as "Reporter" - Then I should see "Mike" in team list as "Reporter" - - @javascript - Scenario: Invite user to project - Given I click link "Add members" - And I select "sjobs@apple.com" as "Reporter" - Then I should see "sjobs@apple.com" in team list as invited "Reporter" - - @javascript - Scenario: Update user access - Given I should see "Sam" in team list as "Developer" - And I change "Sam" role to "Reporter" - And I should see "Sam" in team list as "Reporter" - - Scenario: Cancel team member - Given I click cancel link for "Sam" - Then I visit project "Shop" team page - And I should not see "Sam" in team list - - Scenario: Import team from another project - Given I own project "Website" - And "Mike" is "Website" reporter - When I visit project "Shop" team page - And I click link "Import team from another project" - And I submit "Website" project for import team - Then I should see "Mike" in team list as "Reporter" diff --git a/features/project/wiki.feature b/features/project/wiki.feature deleted file mode 100644 index 977cd609a11..00000000000 --- a/features/project/wiki.feature +++ /dev/null @@ -1,88 +0,0 @@ -Feature: Project Wiki - Background: - Given I sign in as a user - And I own project "Shop" - Given I visit project wiki page - - Scenario: Add new page - Given I create the Wiki Home page - Then I should see the newly created wiki page - - Scenario: Pressing Cancel while editing a brand new Wiki - Given I click on the Cancel button - Then I should be redirected back to the Edit Home Wiki page - - Scenario: Edit existing page - Given I have an existing Wiki page - And I browse to that Wiki page - And I click on the Edit button - And I change the content - Then I should see the updated content - - Scenario: Pressing Cancel while editing an existing Wiki page - Given I have an existing Wiki page - And I browse to that Wiki page - And I click on the Edit button - And I click on the Cancel button - Then I should be redirected back to that Wiki page - - Scenario: View page history - Given I have an existing wiki page - And That page has two revisions - And I browse to that Wiki page - And I click the History button - Then I should see both revisions - - Scenario: Destroy Wiki page - Given I have an existing wiki page - And I browse to that Wiki page - And I click on the Edit button - And I click on the "Delete this page" button - Then The page should be deleted - - Scenario: View all pages - Given I have an existing wiki page - And I browse to that Wiki page - And I click on the "Pages" button - Then I should see the existing page in the pages list - - Scenario: File exists in wiki repo - Given I have an existing Wiki page with images linked on page - And I browse to wiki page with images - And I click on existing image link - Then I should see the image from wiki repo - - Scenario: Image in wiki repo shown on the page - Given I have an existing Wiki page with images linked on page - And I browse to wiki page with images - Then Image should be shown on the page - - Scenario: File does not exist in wiki repo - Given I have an existing Wiki page with images linked on page - And I browse to wiki page with images - And I click on image link - Then I should see the new wiki page form - - @javascript - Scenario: New Wiki page that has a path - Given I create a New page with paths - And I click on the "Pages" button - Then I should see non-escaped link in the pages list - - @javascript - Scenario: Edit Wiki page that has a path - Given I create a New page with paths - And I click on the "Pages" button - And I edit the Wiki page with a path - Then I should see a non-escaped path - And I should see the Editing page - And I change the content - Then I should see the updated content - - @javascript - Scenario: View the page history of a Wiki page that has a path - Given I create a New page with paths - And I click on the "Pages" button - And I view the page history of a Wiki page that has a path - Then I should see a non-escaped path - And I should see the page history diff --git a/features/search.feature b/features/search.feature deleted file mode 100644 index def21e00923..00000000000 --- a/features/search.feature +++ /dev/null @@ -1,46 +0,0 @@ -@dashboard -Feature: Search - Background: - Given I sign in as a user - And I own project "Shop" - And I visit dashboard search page - - Scenario: I should see project I am looking for - Given I search for "Sho" - Then I should see "Shop" project link - - Scenario: I should see issues I am looking for - And project has issues - When I search for "Foo" - And I click "Issues" link - Then I should see "Foo" link in the search results - And I should not see "Bar" link in the search results - - Scenario: I should see merge requests I am looking for - And project has merge requests - When I search for "Foo" - When I click "Merge requests" link - Then I should see "Foo" link in the search results - And I should not see "Bar" link in the search results - - Scenario: I should see project code I am looking for - When I click project "Shop" link - And I search for "rspec" - Then I should see code results for project "Shop" - - Scenario: I should see project issues - And project has issues - When I click project "Shop" link - And I search for "Foo" - And I click "Issues" link - Then I should see "Foo" link in the search results - And I should not see "Bar" link in the search results - - Scenario: I should see project merge requests - And project has merge requests - When I click project "Shop" link - And I search for "Foo" - And I click "Merge requests" link - Then I should see "Foo" link in the search results - And I should not see "Bar" link in the search results - diff --git a/features/snippet_search.feature b/features/snippet_search.feature deleted file mode 100644 index 834bd3b2376..00000000000 --- a/features/snippet_search.feature +++ /dev/null @@ -1,20 +0,0 @@ -@dashboard -Feature: Snippet Search - Background: - Given I sign in as a user - And I have public "Personal snippet one" snippet - And I have private "Personal snippet private" snippet - And I have a public many lined snippet - - Scenario: I should see my public and private snippets - When I search for "snippet" in snippet titles - Then I should see "Personal snippet one" in results - And I should see "Personal snippet private" in results - - Scenario: I should see three surrounding lines on either side of a matching snippet line - When I search for "line seven" in snippet contents - Then I should see "line four" in results - And I should see "line seven" in results - And I should see "line ten" in results - And I should not see "line three" in results - And I should not see "line eleven" in results diff --git a/features/snippets/discover.feature b/features/snippets/discover.feature deleted file mode 100644 index 1a7e132ea25..00000000000 --- a/features/snippets/discover.feature +++ /dev/null @@ -1,13 +0,0 @@ -@snippets -Feature: Snippets Discover - Background: - Given I sign in as a user - And I have public "Personal snippet one" snippet - And I have private "Personal snippet private" snippet - And I have internal "Personal snippet internal" snippet - - Scenario: I should see snippets - Given I visit snippets page - Then I should see "Personal snippet one" in snippets - And I should see "Personal snippet internal" in snippets - And I should not see "Personal snippet private" in snippets diff --git a/features/snippets/public_snippets.feature b/features/snippets/public_snippets.feature deleted file mode 100644 index c2afb63b6d8..00000000000 --- a/features/snippets/public_snippets.feature +++ /dev/null @@ -1,10 +0,0 @@ -Feature: Public snippets - Scenario: Unauthenticated user should see public snippets - Given There is public "Personal snippet one" snippet - And I visit snippet page "Personal snippet one" - Then I should see snippet "Personal snippet one" - - Scenario: Unauthenticated user should see raw public snippets - Given There is public "Personal snippet one" snippet - And I visit snippet raw page "Personal snippet one" - Then I should see raw snippet "Personal snippet one" diff --git a/features/snippets/snippets.feature b/features/snippets/snippets.feature deleted file mode 100644 index 6e8019c326f..00000000000 --- a/features/snippets/snippets.feature +++ /dev/null @@ -1,28 +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 - - 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 "Destroy" - Then I should not see "Personal snippet one" in snippets
\ No newline at end of file diff --git a/features/snippets/user.feature b/features/snippets/user.feature deleted file mode 100644 index 5b5dadb7b39..00000000000 --- a/features/snippets/user.feature +++ /dev/null @@ -1,34 +0,0 @@ -@snippets -Feature: Snippets User - Background: - Given I sign in as a user - And I have public "Personal snippet one" snippet - And I have private "Personal snippet private" snippet - And I have internal "Personal snippet internal" snippet - - Scenario: I should see all my snippets - Given I visit my snippets page - Then I should see "Personal snippet one" in snippets - And I should see "Personal snippet private" in snippets - And I should see "Personal snippet internal" in snippets - - Scenario: I can see only my private snippets - Given I visit my snippets page - And I click "Private" filter - Then I should not see "Personal snippet one" in snippets - And I should not see "Personal snippet internal" in snippets - And I should see "Personal snippet private" in snippets - - Scenario: I can see only my public snippets - Given I visit my snippets page - And I click "Public" filter - Then I should see "Personal snippet one" in snippets - And I should not see "Personal snippet private" in snippets - And I should not see "Personal snippet internal" in snippets - - Scenario: I can see only my internal snippets - Given I visit my snippets page - And I click "Internal" filter - Then I should see "Personal snippet internal" in snippets - And I should not see "Personal snippet private" in snippets - And I should not see "Personal snippet one" in snippets diff --git a/features/steps/admin/active_tab.rb b/features/steps/admin/active_tab.rb deleted file mode 100644 index 90d13abdb13..00000000000 --- a/features/steps/admin/active_tab.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Spinach::Features::AdminActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Home' do - ensure_active_main_tab('Overview') - end - - step 'the active main tab should be Projects' do - ensure_active_main_tab('Projects') - end - - step 'the active main tab should be Groups' do - ensure_active_main_tab('Groups') - end - - step 'the active main tab should be Users' do - ensure_active_main_tab('Users') - end - - step 'the active main tab should be Logs' do - ensure_active_main_tab('Logs') - end - - step 'the active main tab should be Hooks' do - ensure_active_main_tab('Hooks') - end - - step 'the active main tab should be Resque' do - ensure_active_main_tab('Background Jobs') - end - - step 'the active main tab should be Messages' do - ensure_active_main_tab('Messages') - end -end diff --git a/features/steps/admin/applications.rb b/features/steps/admin/applications.rb deleted file mode 100644 index d59088fa3c3..00000000000 --- a/features/steps/admin/applications.rb +++ /dev/null @@ -1,55 +0,0 @@ -class Spinach::Features::AdminApplications < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I click on new application button' do - click_on 'New Application' - end - - step 'I should see application form' do - page.should have_content "New application" - end - - step 'I fill application form out and submit' do - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - click_on "Submit" - end - - step 'I see application' do - page.should have_content "Application: test" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click edit' do - click_on "Edit" - end - - step 'I see edit application form' do - page.should have_content "Edit application" - end - - step 'I change name of application and submit' do - page.should have_content "Edit application" - fill_in :doorkeeper_application_name, with: 'test_changed' - click_on "Submit" - end - - step 'I see that application was changed' do - page.should have_content "test_changed" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click to remove application' do - within '.oauth-applications' do - click_on "Destroy" - end - end - - step "I see that application is removed" do - page.find(".oauth-applications").should_not have_content "test_changed" - end -end diff --git a/features/steps/admin/broadcast_messages.rb b/features/steps/admin/broadcast_messages.rb deleted file mode 100644 index a35fa34a3a2..00000000000 --- a/features/steps/admin/broadcast_messages.rb +++ /dev/null @@ -1,41 +0,0 @@ -class Spinach::Features::AdminBroadcastMessages < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'application already has admin messages' do - FactoryGirl.create(:broadcast_message, message: "Migration to new server") - end - - step 'I should be all broadcast messages' do - page.should have_content "Migration to new server" - end - - step 'submit form with new broadcast message' do - fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST' - select '2018', from: "broadcast_message_ends_at_1i" - click_button "Add broadcast message" - end - - step 'I should be redirected to admin messages page' do - current_path.should == admin_broadcast_messages_path - end - - step 'I should see newly created broadcast message' do - page.should have_content 'Application update from 4:00 CST to 5:00 CST' - end - - step 'submit form with new customized broadcast message' do - fill_in 'broadcast_message_message', with: 'Application update from 4:00 CST to 5:00 CST' - click_link "Customize colors" - fill_in 'broadcast_message_color', with: '#f2dede' - fill_in 'broadcast_message_font', with: '#b94a48' - select '2018', from: "broadcast_message_ends_at_1i" - click_button "Add broadcast message" - end - - step 'I should see a customized broadcast message' do - page.should have_content 'Application update from 4:00 CST to 5:00 CST' - page.should have_selector %(div[style="background-color:#f2dede;color:#b94a48"]) - end -end diff --git a/features/steps/admin/deploy_keys.rb b/features/steps/admin/deploy_keys.rb deleted file mode 100644 index fb0b611762e..00000000000 --- a/features/steps/admin/deploy_keys.rb +++ /dev/null @@ -1,57 +0,0 @@ -class Spinach::Features::AdminDeployKeys < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'there are public deploy keys in system' do - create(:deploy_key, public: true) - create(:another_deploy_key, public: true) - end - - step 'I should see all public deploy keys' do - DeployKey.are_public.each do |p| - page.should have_content p.title - end - end - - step 'I click on first deploy key' do - click_link DeployKey.are_public.first.title - end - - step 'I should see deploy key details' do - deploy_key = DeployKey.are_public.first - current_path.should == admin_deploy_key_path(deploy_key) - page.should have_content(deploy_key.title) - page.should have_content(deploy_key.key) - end - - step 'I visit admin deploy key page' do - visit admin_deploy_key_path(deploy_key) - end - - step 'I visit admin deploy keys page' do - visit admin_deploy_keys_path - end - - step 'I click \'New Deploy Key\'' do - click_link 'New Deploy Key' - end - - step 'I submit new deploy key' do - fill_in "deploy_key_title", with: "laptop" - fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Create" - end - - step 'I should be on admin deploy keys page' do - current_path.should == admin_deploy_keys_path - end - - step 'I should see newly created deploy key' do - page.should have_content(deploy_key.title) - end - - def deploy_key - @deploy_key ||= DeployKey.are_public.first - end -end diff --git a/features/steps/admin/groups.rb b/features/steps/admin/groups.rb deleted file mode 100644 index 721460b9371..00000000000 --- a/features/steps/admin/groups.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::AdminGroups < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedUser - include SharedActiveTab - include Select2Helper - - When 'I visit admin group page' do - visit admin_group_path(current_group) - end - - When 'I click new group link' do - click_link "New Group" - end - - step 'I have group with projects' do - @group = create(:group) - @project = create(:project, group: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'submit form with new group info' do - fill_in 'group_path', with: 'gitlab' - fill_in 'group_description', with: 'Group description' - click_button "Create group" - end - - step 'I should see newly created group' do - page.should have_content "Group: gitlab" - page.should have_content "Group description" - end - - step 'I should be redirected to group page' do - current_path.should == admin_group_path(Group.find_by(path: 'gitlab')) - end - - When 'I select user "John Doe" from user list as "Reporter"' do - select2(user_john.id, from: "#user_ids", multiple: true) - within "#new_project_member" do - select "Reporter", from: "access_level" - end - click_button "Add users to group" - end - - step 'I should see "John Doe" in team list in every project as "Reporter"' do - within ".group-users-list" do - page.should have_content "John Doe" - page.should have_content "Reporter" - end - end - - step 'I should be all groups' do - Group.all.each do |group| - page.should have_content group.name - end - end - - step 'we have user "John Doe" in group' do - current_group.add_user(user_john, Gitlab::Access::REPORTER) - end - - step 'I remove user "John Doe" from group' do - within "#user_#{user_john.id}" do - click_link 'Remove user from group' - end - end - - step 'I should not see "John Doe" in team list' do - within ".group-users-list" do - page.should_not have_content "John Doe" - end - end - - protected - - def current_group - @group ||= Group.first - end - - def user_john - @user_john ||= User.find_by(name: "John Doe") - end -end diff --git a/features/steps/admin/logs.rb b/features/steps/admin/logs.rb deleted file mode 100644 index 904e5468655..00000000000 --- a/features/steps/admin/logs.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Spinach::Features::AdminLogs < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I should see tabs with available logs' do - page.should have_content 'production.log' - page.should have_content 'githost.log' - page.should have_content 'application.log' - end -end diff --git a/features/steps/admin/projects.rb b/features/steps/admin/projects.rb deleted file mode 100644 index 9be4d39d2d5..00000000000 --- a/features/steps/admin/projects.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Spinach::Features::AdminProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I should see all projects' do - Project.all.each do |p| - page.should have_content p.name_with_namespace - end - end - - step 'I click on first project' do - click_link Project.first.name_with_namespace - end - - step 'I should see project details' do - project = Project.first - current_path.should == admin_namespace_project_path(project.namespace, project) - page.should have_content(project.name_with_namespace) - page.should have_content(project.creator.name) - end - - step 'I visit admin project page' do - visit admin_namespace_project_path(project.namespace, project) - end - - step 'I transfer project to group \'Web\'' do - find(:xpath, "//input[@id='new_namespace_id']").set group.id - click_button 'Transfer' - end - - step 'group \'Web\'' do - create(:group, name: 'Web') - end - - step 'I should see project transfered' do - page.should have_content 'Web / ' + project.name - page.should have_content 'Namespace: Web' - end - - def project - @project ||= Project.first - end - - def group - Group.find_by(name: 'Web') - end -end diff --git a/features/steps/admin/settings.rb b/features/steps/admin/settings.rb deleted file mode 100644 index 87d4e969ff5..00000000000 --- a/features/steps/admin/settings.rb +++ /dev/null @@ -1,47 +0,0 @@ -class Spinach::Features::AdminSettings < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - include Gitlab::CurrentSettings - - step 'I modify settings and save form' do - uncheck 'Gravatar enabled' - fill_in 'Home page url', with: 'https://about.gitlab.com/' - click_button 'Save' - end - - step 'I should see application settings saved' do - current_application_settings.gravatar_enabled.should be_false - current_application_settings.home_page_url.should == 'https://about.gitlab.com/' - page.should have_content 'Application settings saved successfully' - end - - step 'I click on "Service Templates"' do - click_link 'Service Templates' - end - - step 'I click on "Slack" service' do - click_link 'Slack' - end - - step 'I check all events and submit form' do - page.check('Active') - page.check('Push events') - page.check('Tag push events') - page.check('Comments') - page.check('Issues events') - page.check('Merge Request events') - fill_in 'Webhook', with: "http://localhost" - click_on 'Save' - end - - step 'I should see service template settings saved' do - page.should have_content 'Application settings saved successfully' - end - - step 'I should see all checkboxes checked' do - all('input[type=checkbox]').each do |checkbox| - checkbox.should be_checked - end - end -end diff --git a/features/steps/admin/users.rb b/features/steps/admin/users.rb deleted file mode 100644 index e1383097248..00000000000 --- a/features/steps/admin/users.rb +++ /dev/null @@ -1,117 +0,0 @@ -class Spinach::Features::AdminUsers < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedAdmin - - step 'I should see all users' do - User.all.each do |user| - page.should have_content user.name - end - end - - step 'Click edit' do - @user = User.first - find("#edit_user_#{@user.id}").click - end - - step 'Input non ascii char in username' do - fill_in 'user_username', with: "\u3042\u3044" - end - - step 'Click save' do - click_button("Save") - end - - step 'See username error message' do - within "#error_explanation" do - page.should have_content "Username" - end - end - - step 'Not changed form action url' do - page.should have_selector %(form[action="/admin/users/#{@user.username}"]) - end - - step 'I submit modified user' do - check :user_can_create_group - click_button 'Save' - end - - step 'I see user attributes changed' do - page.should have_content 'Can create groups: Yes' - end - - step 'click edit on my user' do - find("#edit_user_#{current_user.id}").click - end - - step 'I view the user with secondary email' do - @user_with_secondary_email = User.last - @user_with_secondary_email.emails.new(email: "secondary@example.com") - @user_with_secondary_email.save - visit "/admin/users/#{@user_with_secondary_email.username}" - end - - step 'I see the secondary email' do - page.should have_content "Secondary email: #{@user_with_secondary_email.emails.last.email}" - end - - step 'I click remove secondary email' do - find("#remove_email_#{@user_with_secondary_email.emails.last.id}").click - end - - step 'I should not see secondary email anymore' do - page.should_not have_content "Secondary email:" - end - - step 'user "Mike" with groups and projects' do - user = create(:user, name: 'Mike') - - project = create(:empty_project) - project.team << [user, :developer] - - group = create(:group) - group.add_user(user, Gitlab::Access::DEVELOPER) - end - - step 'click on "Mike" link' do - click_link "Mike" - end - - step 'I should see user "Mike" details' do - page.should have_content 'Account' - page.should have_content 'Personal projects limit' - end - - step 'user "Pete" with ssh keys' do - user = create(:user, name: 'Pete') - create(:key, user: user, title: "ssh-rsa Key1", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4FIEBXGi4bPU8kzxMefudPIJ08/gNprdNTaO9BR/ndy3+58s2HCTw2xCHcsuBmq+TsAqgEidVq4skpqoTMB+Uot5Uzp9z4764rc48dZiI661izoREoKnuRQSsRqUTHg5wrLzwxlQbl1MVfRWQpqiz/5KjBC7yLEb9AbusjnWBk8wvC1bQPQ1uLAauEA7d836tgaIsym9BrLsMVnR4P1boWD3Xp1B1T/ImJwAGHvRmP/ycIqmKdSpMdJXwxcb40efWVj0Ibbe7ii9eeoLdHACqevUZi6fwfbymdow+FeqlkPoHyGg3Cu4vD/D8+8cRc7mE/zGCWcQ15Var83Tczour Key1") - create(:key, user: user, title: "ssh-rsa Key2", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2") - end - - step 'click on user "Pete"' do - click_link 'Pete' - end - - step 'I should see key list' do - page.should have_content 'ssh-rsa Key2' - page.should have_content 'ssh-rsa Key1' - end - - step 'I click on the key title' do - click_link 'ssh-rsa Key2' - end - - step 'I should see key details' do - page.should have_content 'ssh-rsa Key2' - page.should have_content 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDQSTWXhJAX/He+nG78MiRRRn7m0Pb0XbcgTxE0etArgoFoh9WtvDf36HG6tOSg/0UUNcp0dICsNAmhBKdncp6cIyPaXJTURPRAGvhI0/VDk4bi27bRnccGbJ/hDaUxZMLhhrzY0r22mjVf8PF6dvv5QUIQVm1/LeaWYsHHvLgiIjwrXirUZPnFrZw6VLREoBKG8uWvfSXw1L5eapmstqfsME8099oi+vWLR8MgEysZQmD28M73fgW4zek6LDQzKQyJx9nB+hJkKUDvcuziZjGmRFlNgSA2mguERwL1OXonD8WYUrBDGKroIvBT39zS5d9tQDnidEJZ9Y8gv5ViYP7x Key2' - end - - step 'I click on remove key' do - click_link 'Remove' - end - - step 'I should see the key removed' do - page.should_not have_content 'ssh-rsa Key2' - end -end diff --git a/features/steps/dashboard/active_tab.rb b/features/steps/dashboard/active_tab.rb deleted file mode 100644 index 0e2c04fb299..00000000000 --- a/features/steps/dashboard/active_tab.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Spinach::Features::DashboardActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Help' do - ensure_active_main_tab('Help') - end -end diff --git a/features/steps/dashboard/archived_projects.rb b/features/steps/dashboard/archived_projects.rb deleted file mode 100644 index 969baf92287..00000000000 --- a/features/steps/dashboard/archived_projects.rb +++ /dev/null @@ -1,22 +0,0 @@ -class Spinach::Features::DashboardArchivedProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - When 'project "Forum" is archived' do - project = Project.find_by(name: "Forum") - project.update_attribute(:archived, true) - end - - step 'I should see "Shop" project link' do - page.should have_link "Shop" - end - - step 'I should not see "Forum" project link' do - page.should_not have_link "Forum" - end - - step 'I should see "Forum" project link' do - page.should have_link "Forum" - end -end diff --git a/features/steps/dashboard/dashboard.rb b/features/steps/dashboard/dashboard.rb deleted file mode 100644 index 8508b2a8096..00000000000 --- a/features/steps/dashboard/dashboard.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::Dashboard < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see "New Project" link' do - page.should have_link "New project" - end - - step 'I should see "Shop" project link' do - page.should have_link "Shop" - end - - step 'I should see last push widget' do - page.should have_content "You pushed to fix" - page.should have_link "Create Merge Request" - end - - step 'I click "Create Merge Request" link' do - click_link "Create Merge Request" - end - - step 'I see prefilled new Merge Request page' do - current_path.should == new_namespace_project_merge_request_path(@project.namespace, @project) - find("#merge_request_target_project_id").value.should == @project.id.to_s - find("#merge_request_source_branch").value.should == "fix" - find("#merge_request_target_branch").value.should == "master" - end - - step 'user with name "John Doe" joined project "Shop"' do - user = create(:user, {name: "John Doe"}) - project.team << [user, :master] - Event.create( - project: project, - author_id: user.id, - action: Event::JOINED - ) - end - - step 'I should see "John Doe joined project Shop" event' do - page.should have_content "John Doe joined project #{project.name_with_namespace}" - end - - step 'user with name "John Doe" left project "Shop"' do - user = User.find_by(name: "John Doe") - Event.create( - project: project, - author_id: user.id, - action: Event::LEFT - ) - end - - step 'I should see "John Doe left project Shop" event' do - page.should have_content "John Doe left project #{project.name_with_namespace}" - end - - step 'I have group with projects' do - @group = create(:group) - @project = create(:project, namespace: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'I should see projects list' do - @user.authorized_projects.all.each do |project| - page.should have_link project.name_with_namespace - end - end - - step 'I should see groups list' do - Group.all.each do |group| - page.should have_link group.name - end - end - - step 'group has a projects that does not belongs to me' do - @forbidden_project1 = create(:project, group: @group) - @forbidden_project2 = create(:project, group: @group) - end - - step 'I should see 1 project at group list' do - find('span.last_activity/span').should have_content('1') - end -end diff --git a/features/steps/dashboard/event_filters.rb b/features/steps/dashboard/event_filters.rb deleted file mode 100644 index 3da3d62d0c0..00000000000 --- a/features/steps/dashboard/event_filters.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::EventFilters < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see push event' do - page.should have_selector('span.pushed') - end - - step 'I should not see push event' do - page.should_not have_selector('span.pushed') - end - - step 'I should see new member event' do - page.should have_selector('span.joined') - end - - step 'I should not see new member event' do - page.should_not have_selector('span.joined') - end - - step 'I should see merge request event' do - page.should have_selector('span.accepted') - end - - step 'I should not see merge request event' do - page.should_not 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 - click_link("push_event_filter") - end - - When 'I click "team" event filter' do - click_link("team_event_filter") - end - - When 'I click "merge" event filter' do - click_link("merged_event_filter") - end -end diff --git a/features/steps/dashboard/group.rb b/features/steps/dashboard/group.rb deleted file mode 100644 index 8384df2fb59..00000000000 --- a/features/steps/dashboard/group.rb +++ /dev/null @@ -1,63 +0,0 @@ -class Spinach::Features::DashboardGroup < Spinach::FeatureSteps - include SharedAuthentication - include SharedGroup - include SharedPaths - include SharedUser - - # Leave - - step 'I click on the "Leave" button for group "Owned"' do - find(:css, 'li', text: "Owner").find(:css, 'i.fa.fa-sign-out').click - # poltergeist always confirms popups. - end - - step 'I click on the "Leave" button for group "Guest"' do - find(:css, 'li', text: "Guest").find(:css, 'i.fa.fa-sign-out').click - # poltergeist always confirms popups. - end - - step 'I should not see the "Leave" button for group "Owned"' do - find(:css, 'li', text: "Owner").should_not have_selector(:css, 'i.fa.fa-sign-out') - # poltergeist always confirms popups. - end - - step 'I should not see the "Leave" button for groupr "Guest"' do - find(:css, 'li', text: "Guest").should_not have_selector(:css, 'i.fa.fa-sign-out') - # poltergeist always confirms popups. - end - - step 'I should see group "Owned" in group list' do - page.should have_content("Owned") - end - - step 'I should not see group "Owned" in group list' do - page.should_not have_content("Owned") - end - - step 'I should see group "Guest" in group list' do - page.should have_content("Guest") - end - - step 'I should not see group "Guest" in group list' do - page.should_not have_content("Guest") - end - - step 'I click new group link' do - click_link "New Group" - end - - step 'submit form with new group "Samurai" info' do - fill_in 'group_path', with: 'Samurai' - fill_in 'group_description', with: 'Tokugawa Shogunate' - click_button "Create group" - end - - step 'I should be redirected to group "Samurai" page' do - current_path.should == group_path(Group.find_by(name: 'Samurai')) - end - - step 'I should see newly created group "Samurai"' do - page.should have_content "Samurai" - page.should have_content "Tokugawa Shogunate" - end -end diff --git a/features/steps/dashboard/issues.rb b/features/steps/dashboard/issues.rb deleted file mode 100644 index 60da36e86de..00000000000 --- a/features/steps/dashboard/issues.rb +++ /dev/null @@ -1,83 +0,0 @@ -class Spinach::Features::DashboardIssues < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include Select2Helper - - step 'I should see issues assigned to me' do - should_see(assigned_issue) - should_not_see(authored_issue) - should_not_see(other_issue) - end - - step 'I should see issues authored by me' do - should_see(authored_issue) - should_see(authored_issue_on_public_project) - should_not_see(assigned_issue) - should_not_see(other_issue) - end - - step 'I should see all issues' do - should_see(authored_issue) - should_see(assigned_issue) - should_see(other_issue) - end - - step 'I have authored issues' do - authored_issue - authored_issue_on_public_project - end - - step 'I have assigned issues' do - assigned_issue - end - - step 'I have other issues' do - other_issue - end - - step 'I click "Authored by me" link' do - select2(current_user.id, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - step 'I click "All" link' do - select2(nil, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - def should_see(issue) - page.should have_content(issue.title[0..10]) - end - - def should_not_see(issue) - page.should_not have_content(issue.title[0..10]) - end - - def assigned_issue - @assigned_issue ||= create :issue, assignee: current_user, project: project - end - - def authored_issue - @authored_issue ||= create :issue, author: current_user, project: project - end - - def other_issue - @other_issue ||= create :issue, project: project - end - - def authored_issue_on_public_project - @authored_issue_on_public_project ||= create :issue, author: current_user, project: public_project - end - - def project - @project ||= begin - project =create :project - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create :project, :public - end -end diff --git a/features/steps/dashboard/merge_requests.rb b/features/steps/dashboard/merge_requests.rb deleted file mode 100644 index 9d92082bb83..00000000000 --- a/features/steps/dashboard/merge_requests.rb +++ /dev/null @@ -1,113 +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 - select2(current_user.id, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - step 'I click "All" link' do - select2(nil, from: "#author_id") - select2(nil, from: "#assignee_id") - end - - def should_see(merge_request) - page.should have_content(merge_request.title[0..10]) - end - - def should_not_see(merge_request) - page.should_not 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: 'simple_merge_request', - author: current_user, - target_project: project, - source_project: project - end - - def other_merge_request - @other_merge_request ||= create :merge_request, - source_branch: '2_3_notes_fix', - target_project: project, - source_project: project - end - - def authored_merge_request_from_fork - @authored_merge_request_from_fork ||= create :merge_request, - source_branch: 'basic_page', - 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: 'basic_page_fix', - assignee: current_user, - target_project: public_project, - source_project: forked_project - end - - def project - @project ||= begin - project =create :project - project.team << [current_user, :master] - project - end - end - - def public_project - @public_project ||= create :project, :public - 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 5e588ceb780..00000000000 --- a/features/steps/dashboard/new_project.rb +++ /dev/null @@ -1,27 +0,0 @@ -class Spinach::Features::NewProject < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click "New project" link' do - click_link "New project" - end - - step 'I see "New project" page' do - page.should have_content("Project path") - end - - step 'I click on "Import project from GitHub"' do - first('.how_to_import_link').click - end - - step 'I see instructions on how to import from GitHub' do - github_modal = first('.modal-body') - github_modal.should be_visible - github_modal.should have_content "To enable importing projects from GitHub" - - all('.modal-body').each do |element| - element.should_not be_visible unless element == github_modal - end - end -end diff --git a/features/steps/dashboard/shortcuts.rb b/features/steps/dashboard/shortcuts.rb deleted file mode 100644 index a9083850b52..00000000000 --- a/features/steps/dashboard/shortcuts.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Spinach::Features::DashboardShortcuts < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedActiveTab -end diff --git a/features/steps/dashboard/starred_projects.rb b/features/steps/dashboard/starred_projects.rb deleted file mode 100644 index b9ad2f13e29..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 - within 'aside' do - page.should_not have_content('Shop') - end - end -end diff --git a/features/steps/explore/groups.rb b/features/steps/explore/groups.rb deleted file mode 100644 index 0c2127d4c4b..00000000000 --- a/features/steps/explore/groups.rb +++ /dev/null @@ -1,92 +0,0 @@ -class Spinach::Features::ExploreGroups < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedGroup - include SharedProject - - step 'group "TestGroup" has private project "Enterprise"' do - group_has_project("TestGroup", "Enterprise", Gitlab::VisibilityLevel::PRIVATE) - end - - step 'group "TestGroup" has internal project "Internal"' do - group_has_project("TestGroup", "Internal", Gitlab::VisibilityLevel::INTERNAL) - end - - step 'group "TestGroup" has public project "Community"' do - group_has_project("TestGroup", "Community", Gitlab::VisibilityLevel::PUBLIC) - end - - step '"John Doe" is owner of group "TestGroup"' do - group = Group.find_by(name: "TestGroup") || create(:group, name: "TestGroup") - user = create(:user, name: "John Doe") - group.add_user(user, Gitlab::Access::OWNER) - end - - step 'I visit group "TestGroup" page' do - visit group_path(Group.find_by(name: "TestGroup")) - end - - step 'I visit group "TestGroup" issues page' do - visit issues_group_path(Group.find_by(name: "TestGroup")) - end - - step 'I visit group "TestGroup" merge requests page' do - visit merge_requests_group_path(Group.find_by(name: "TestGroup")) - end - - step 'I visit group "TestGroup" members page' do - visit group_group_members_path(Group.find_by(name: "TestGroup")) - end - - step 'I should not see project "Enterprise" items' do - page.should_not have_content "Enterprise" - end - - step 'I should see project "Internal" items' do - page.should have_content "Internal" - end - - step 'I should not see project "Internal" items' do - page.should_not have_content "Internal" - end - - step 'I should see project "Community" items' do - page.should have_content "Community" - end - - step 'I change filter to Everyone\'s' do - click_link "Everyone's" - end - - step 'I should see group member "John Doe"' do - page.should have_content "John Doe" - end - - step 'I should not see member roles' do - body.should_not match(%r{owner|developer|reporter|guest}i) - end - - protected - - def group_has_project(groupname, projectname, visibility_level) - group = Group.find_by(name: groupname) || create(:group, name: groupname) - project = create(:project, - namespace: group, - name: projectname, - path: "#{groupname}-#{projectname}", - visibility_level: visibility_level - ) - create(:issue, - title: "#{projectname} feature", - project: project - ) - create(:merge_request, - title: "#{projectname} feature implemented", - source_project: project, - target_project: project - ) - create(:closed_issue_event, - project: project - ) - end -end diff --git a/features/steps/explore/projects.rb b/features/steps/explore/projects.rb deleted file mode 100644 index 26b71406bd8..00000000000 --- a/features/steps/explore/projects.rb +++ /dev/null @@ -1,148 +0,0 @@ -class Spinach::Features::ExploreProjects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I should see project "Empty Public Project"' do - page.should have_content "Empty Public Project" - end - - step 'I should see public project details' do - page.should have_content '32 branches' - page.should have_content '16 tags' - end - - step 'I should see project readme' do - page.should have_content 'README.md' - end - - step 'I should see empty public project details' do - page.should have_content 'Git global setup' - end - - step 'I should see empty public project details with http clone info' do - project = Project.find_by(name: 'Empty Public Project') - all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.http_url_to_repo) - end - end - - step 'I should see empty public project details with ssh clone info' do - project = Project.find_by(name: 'Empty Public Project') - all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.url_to_repo) - end - end - - step 'I should see project "Community" home page' do - within '.navbar-gitlab .title' do - page.should have_content 'Community' - end - end - - step 'I should see project "Internal" home page' do - within '.navbar-gitlab .title' do - page.should have_content 'Internal' - end - end - - step 'I should see an http link to the repository' do - project = Project.find_by(name: 'Community') - page.should have_field('project_clone', with: project.http_url_to_repo) - end - - step 'I should see an ssh link to the repository' do - project = Project.find_by(name: 'Community') - page.should have_field('project_clone', with: project.url_to_repo) - end - - step 'I visit "Community" issues page' do - create(:issue, - title: "Bug", - project: public_project - ) - create(:issue, - title: "New feature", - project: public_project - ) - visit namespace_project_issues_path(public_project.namespace, public_project) - end - - - step 'I should see list of issues for "Community" project' do - page.should have_content "Bug" - page.should have_content public_project.name - page.should have_content "New feature" - end - - step 'I visit "Internal" issues page' do - create(:issue, - title: "Internal Bug", - project: internal_project - ) - create(:issue, - title: "New internal feature", - project: internal_project - ) - visit namespace_project_issues_path(internal_project.namespace, internal_project) - end - - - step 'I should see list of issues for "Internal" project' do - page.should have_content "Internal Bug" - page.should have_content internal_project.name - page.should have_content "New internal feature" - end - - step 'I visit "Community" merge requests page' do - visit namespace_project_merge_requests_path(public_project.namespace, public_project) - end - - step 'project "Community" has "Bug fix" open merge request' do - create(:merge_request, - title: "Bug fix for public project", - source_project: public_project, - target_project: public_project, - ) - end - - step 'I should see list of merge requests for "Community" project' do - page.should have_content public_project.name - page.should have_content public_merge_request.source_project.name - end - - step 'I visit "Internal" merge requests page' do - visit namespace_project_merge_requests_path(internal_project.namespace, internal_project) - end - - step 'project "Internal" has "Feature implemented" open merge request' do - create(:merge_request, - title: "Feature implemented", - source_project: internal_project, - target_project: internal_project - ) - end - - step 'I should see list of merge requests for "Internal" project' do - page.should have_content internal_project.name - page.should have_content internal_merge_request.source_project.name - end - - def internal_project - @internal_project ||= Project.find_by!(name: 'Internal') - end - - def public_project - @public_project ||= Project.find_by!(name: 'Community') - end - - - def internal_merge_request - @internal_merge_request ||= MergeRequest.find_by!(title: 'Feature implemented') - end - - def public_merge_request - @public_merge_request ||= MergeRequest.find_by!(title: 'Bug fix for public project') - end -end - diff --git a/features/steps/groups.rb b/features/steps/groups.rb deleted file mode 100644 index 228b83e5fd0..00000000000 --- a/features/steps/groups.rb +++ /dev/null @@ -1,300 +0,0 @@ -class Spinach::Features::Groups < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedGroup - include SharedUser - include Select2Helper - - step 'gitlab user "Mike"' do - create(:user, name: "Mike") - end - - step 'I click link "Add members"' do - find(:css, 'button.btn-new').click - end - - step 'I select "Mike" as "Reporter"' do - user = User.find_by(name: "Mike") - - within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add users to group" - end - - step 'I should see "Mike" in team list as "Reporter"' do - within '.well-list' do - page.should have_content('Mike') - page.should have_content('Reporter') - end - end - - step 'I select "sjobs@apple.com" as "Reporter"' do - within ".users-group-form" do - select2("sjobs@apple.com", from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - - click_button "Add users to group" - end - - step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do - within '.well-list' do - page.should have_content('sjobs@apple.com') - page.should have_content('invited') - page.should have_content('Reporter') - end - end - - step 'I should see group "Owned" projects list' do - Group.find_by(name: "Owned").projects.each do |project| - page.should have_link project.name - end - end - - step 'I should see projects activity feed' do - page.should have_content 'closed issue' - end - - step 'I should see issues from group "Owned" assigned to me' do - assigned_to_me(:issues).each do |issue| - page.should have_content issue.title - end - end - - step 'I should see merge requests from group "Owned" assigned to me' do - assigned_to_me(:merge_requests).each do |issue| - page.should have_content issue.title[0..80] - end - end - - step 'I select user "Mary Jane" from list with role "Reporter"' do - user = User.find_by(name: "Mary Jane") || create(:user, name: "Mary Jane") - click_button 'Add members' - within ".users-group-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add users to group" - end - - step 'I should see user "John Doe" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should have_content("John Doe") - end - - step 'I should not see user "John Doe" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should_not have_content("John Doe") - end - - step 'I should see user "Mary Jane" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should have_content("Mary Jane") - end - - step 'I should not see user "Mary Jane" in team list' do - projects_with_access = find(".panel .well-list") - projects_with_access.should_not have_content("Mary Jane") - end - - step 'project from group "Owned" has issues assigned to me' do - create :issue, - project: project, - assignee: current_user, - author: current_user - end - - step 'project from group "Owned" has merge requests assigned to me' do - create :merge_request, - source_project: project, - target_project: project, - assignee: current_user, - author: current_user - end - - step 'I change group "Owned" name to "new-name"' do - fill_in 'group_name', with: 'new-name' - fill_in 'group_path', with: 'new-name' - click_button "Save group" - end - - step 'I should see new group "Owned" name' do - within ".navbar-gitlab" do - page.should have_content "new-name" - end - end - - step 'I change group "Owned" avatar' do - attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save group" - Group.find_by(name: "Owned").reload - end - - step 'I should see new group "Owned" avatar' do - Group.find_by(name: "Owned").avatar.should be_instance_of AvatarUploader - Group.find_by(name: "Owned").avatar.url.should == "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png" - end - - step 'I should see the "Remove avatar" button' do - page.should have_link("Remove avatar") - end - - step 'I have group "Owned" avatar' do - attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save group" - Group.find_by(name: "Owned").reload - end - - step 'I remove group "Owned" avatar' do - click_link "Remove avatar" - Group.find_by(name: "Owned").reload - end - - step 'I should not see group "Owned" avatar' do - Group.find_by(name: "Owned").avatar?.should be_false - end - - step 'I should not see the "Remove avatar" button' do - page.should_not have_link("Remove avatar") - end - - step 'I click on the "Remove User From Group" button for "John Doe"' do - find(:css, 'li', text: "John Doe").find(:css, 'a.btn-remove').click - # poltergeist always confirms popups. - end - - step 'I click on the "Remove User From Group" button for "Mary Jane"' do - find(:css, 'li', text: "Mary Jane").find(:css, 'a.btn-remove').click - # poltergeist always confirms popups. - end - - step 'I should not see the "Remove User From Group" button for "John Doe"' do - find(:css, 'li', text: "John Doe").should_not have_selector(:css, 'a.btn-remove') - # poltergeist always confirms popups. - end - - step 'I should not see the "Remove User From Group" button for "Mary Jane"' do - find(:css, 'li', text: "Mary Jane").should_not have_selector(:css, 'a.btn-remove') - # poltergeist always confirms popups. - end - - step 'I search for \'Mary\' member' do - within '.member-search-form' do - fill_in 'search', with: 'Mary' - click_button 'Search' - end - end - - step 'I click on group milestones' do - click_link 'Milestones' - end - - step 'I should see group milestones index page has no milestones' do - page.should have_content('No milestones to show') - end - - step 'Group has projects with milestones' do - group_milestone - end - - step 'I should see group milestones index page with milestones' do - page.should have_content('Version 7.2') - page.should have_content('GL-113') - page.should have_link('2 Issues', href: group_milestone_path("owned", "version-7-2", title: "Version 7.2")) - page.should have_link('3 Merge Requests', href: group_milestone_path("owned", "gl-113", title: "GL-113")) - end - - step 'I click on one group milestone' do - click_link 'GL-113' - end - - step 'I should see group milestone with descriptions and expiry date' do - page.should have_content('expires at Aug 20, 2114') - end - - step 'I should see group milestone with all issues and MRs assigned to that milestone' do - page.should have_content('Milestone GL-113') - page.should have_content('Progress: 0 closed – 4 open') - page.should have_link(@issue1.title, href: namespace_project_issue_path(@project1.namespace, @project1, @issue1)) - page.should have_link(@mr3.title, href: namespace_project_merge_request_path(@project3.namespace, @project3, @mr3)) - end - - protected - - def assigned_to_me(key) - project.send(key).where(assignee_id: current_user.id) - end - - def project - Group.find_by(name: "Owned").projects.first - end - - def group_milestone - group = Group.find_by(name: "Owned") - - @project1 = create :project, - group: group - project2 = create :project, - path: 'gitlab-ci', - group: group - @project3 = create :project, - path: 'cookbook-gitlab', - group: group - milestone1_project1 = create :milestone, - title: "Version 7.2", - project: @project1 - milestone1_project2 = create :milestone, - title: "Version 7.2", - project: project2 - milestone1_project3 = create :milestone, - title: "Version 7.2", - project: @project3 - milestone2_project1 = create :milestone, - title: "GL-113", - project: @project1 - milestone2_project2 = create :milestone, - title: "GL-113", - project: project2 - milestone2_project3 = create :milestone, - title: "GL-113", - project: @project3, - due_date: '2114-08-20', - description: 'Lorem Ipsum is simply dummy text of the printing and typesetting industry' - @issue1 = create :issue, - project: @project1, - assignee: current_user, - author: current_user, - milestone: milestone2_project1 - issue2 = create :issue, - project: project2, - assignee: current_user, - author: current_user, - milestone: milestone1_project2 - issue3 = create :issue, - project: @project3, - assignee: current_user, - author: current_user, - milestone: milestone1_project1 - mr1 = create :merge_request, - source_project: @project1, - target_project: @project1, - assignee: current_user, - author: current_user, - milestone: milestone2_project1 - mr2 = create :merge_request, - source_project: project2, - target_project: project2, - assignee: current_user, - author: current_user, - milestone: milestone2_project2 - @mr3 = create :merge_request, - source_project: @project3, - target_project: @project3, - assignee: current_user, - author: current_user, - milestone: milestone2_project3 - end -end diff --git a/features/steps/invites.rb b/features/steps/invites.rb deleted file mode 100644 index d051cc3edc8..00000000000 --- a/features/steps/invites.rb +++ /dev/null @@ -1,80 +0,0 @@ -class Spinach::Features::Invites < Spinach::FeatureSteps - include SharedAuthentication - include SharedUser - include SharedGroup - - step '"John Doe" has invited "user@example.com" to group "Owned"' do - user = User.find_by(name: "John Doe") - group = Group.find_by(name: "Owned") - group.add_user("user@example.com", Gitlab::Access::DEVELOPER, user) - end - - step 'I visit the invitation page' do - group = Group.find_by(name: "Owned") - invite = group.group_members.invite.last - invite.generate_invite_token! - @raw_invite_token = invite.raw_invite_token - visit invite_path(@raw_invite_token) - end - - step 'I should be redirected to the sign in page' do - expect(current_path).to eq(new_user_session_path) - end - - step 'I should see a notice telling me to sign in' do - expect(page).to have_content "To accept this invitation, sign in" - end - - step 'I should be redirected to the invitation page' do - expect(current_path).to eq(invite_path(@raw_invite_token)) - end - - step 'I should see the invitation details' do - expect(page).to have_content("You have been invited by John Doe to join group Owned as Developer.") - end - - step "I should see a message telling me I'm already a member" do - expect(page).to have_content("However, you are already a member of this group.") - end - - step 'I should see an "Accept invitation" button' do - expect(page).to have_link("Accept invitation") - end - - step 'I should see a "Decline" button' do - expect(page).to have_link("Decline") - end - - step 'I click the "Accept invitation" button' do - page.click_link "Accept invitation" - end - - step 'I should be redirected to the group page' do - group = Group.find_by(name: "Owned") - expect(current_path).to eq(group_path(group)) - end - - step 'I should see a notice telling me I have access' do - expect(page).to have_content("You have been granted Developer access to group Owned.") - end - - step 'I click the "Decline" button' do - page.click_link "Decline" - end - - step 'I should be redirected to the dashboard' do - expect(current_path).to eq(dashboard_path) - end - - step 'I should see a notice telling me I have declined' do - expect(page).to have_content("You have declined the invitation to join group Owned.") - end - - step "I visit the invitation's decline page" do - group = Group.find_by(name: "Owned") - invite = group.group_members.invite.last - invite.generate_invite_token! - @raw_invite_token = invite.raw_invite_token - visit decline_invite_path(@raw_invite_token) - end -end diff --git a/features/steps/profile/active_tab.rb b/features/steps/profile/active_tab.rb deleted file mode 100644 index 8595ee876a4..00000000000 --- a/features/steps/profile/active_tab.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Spinach::Features::ProfileActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedActiveTab - - step 'the active main tab should be Home' do - ensure_active_main_tab('Profile') - end - - step 'the active main tab should be Account' do - ensure_active_main_tab('Account') - end - - step 'the active main tab should be SSH Keys' do - ensure_active_main_tab('SSH Keys') - end - - step 'the active main tab should be Design' do - ensure_active_main_tab('Design') - end - - step 'the active main tab should be History' do - ensure_active_main_tab('History') - end -end diff --git a/features/steps/profile/emails.rb b/features/steps/profile/emails.rb deleted file mode 100644 index 2b6ac37d866..00000000000 --- a/features/steps/profile/emails.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Spinach::Features::ProfileEmails < Spinach::FeatureSteps - include SharedAuthentication - - step 'I visit profile emails page' do - visit profile_emails_path - end - - step 'I should see my emails' do - page.should have_content(@user.email) - @user.emails.each do |email| - page.should have_content(email.email) - end - end - - step 'I submit new email "my@email.com"' do - fill_in "email_email", with: "my@email.com" - click_button "Add" - end - - step 'I should see new email "my@email.com"' do - email = @user.emails.find_by(email: "my@email.com") - email.should_not be_nil - page.should have_content("my@email.com") - end - - step 'I should not see email "my@email.com"' do - email = @user.emails.find_by(email: "my@email.com") - email.should be_nil - page.should_not have_content("my@email.com") - end - - step 'I click link "Remove" for "my@email.com"' do - # there should only be one remove button at this time - click_link "Remove" - # force these to reload as they have been cached - @user.emails.reload - end - - step 'I submit duplicate email @user.email' do - fill_in "email_email", with: @user.email - click_button "Add" - end - - step 'I should not have @user.email added' do - email = @user.emails.find_by(email: @user.email) - email.should be_nil - end -end diff --git a/features/steps/profile/notifications.rb b/features/steps/profile/notifications.rb deleted file mode 100644 index 13e93618eb7..00000000000 --- a/features/steps/profile/notifications.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Spinach::Features::ProfileNotifications < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - - step 'I visit profile notifications page' do - visit profile_notifications_path - end - - step 'I should see global notifications settings' do - page.should have_content "Notifications Settings" - end -end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb deleted file mode 100644 index 791982d16c3..00000000000 --- a/features/steps/profile/profile.rb +++ /dev/null @@ -1,242 +0,0 @@ -class Spinach::Features::Profile < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'I should see my profile info' do - page.should have_content "Profile Settings" - end - - step 'I change my profile info' do - fill_in "user_skype", with: "testskype" - fill_in "user_linkedin", with: "testlinkedin" - fill_in "user_twitter", with: "testtwitter" - fill_in "user_website_url", with: "testurl" - fill_in "user_location", with: "Ukraine" - click_button "Save changes" - @user.reload - end - - step 'I should see new profile info' do - @user.skype.should == 'testskype' - @user.linkedin.should == 'testlinkedin' - @user.twitter.should == 'testtwitter' - @user.website_url.should == 'testurl' - find("#user_location").value.should == "Ukraine" - end - - step 'I change my avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save changes" - @user.reload - end - - step 'I should see new avatar' do - @user.avatar.should be_instance_of AvatarUploader - @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" - end - - step 'I should see the "Remove avatar" button' do - page.should have_link("Remove avatar") - end - - step 'I have an avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) - click_button "Save changes" - @user.reload - end - - step 'I remove my avatar' do - click_link "Remove avatar" - @user.reload - end - - step 'I should see my gravatar' do - @user.avatar?.should be_false - end - - step 'I should not see the "Remove avatar" button' do - page.should_not have_link("Remove avatar") - end - - step 'I try change my password w/o old one' do - within '.update-password' do - fill_in "user_password", with: "22233344" - fill_in "user_password_confirmation", with: "22233344" - click_button "Save" - end - end - - step 'I change my password' do - within '.update-password' do - fill_in "user_current_password", with: "12345678" - fill_in "user_password", with: "22233344" - fill_in "user_password_confirmation", with: "22233344" - click_button "Save" - end - end - - step 'I unsuccessfully change my password' do - within '.update-password' do - fill_in "user_current_password", with: "12345678" - fill_in "user_password", with: "password" - fill_in "user_password_confirmation", with: "confirmation" - click_button "Save" - end - end - - step "I should see a missing password error message" do - page.should have_content "You must provide a valid current password" - end - - step "I should see a password error message" do - page.should have_content "Password confirmation doesn't match" - end - - step 'I reset my token' do - within '.update-token' do - @old_token = @user.private_token - click_button "Reset" - end - end - - step 'I should see new token' do - find("#token").value.should_not == @old_token - find("#token").value.should == @user.reload.private_token - end - - step 'I have activity' do - create(:closed_issue_event, author: current_user) - end - - step 'I should see my activity' do - page.should have_content "#{current_user.name} closed issue" - end - - step "I change my application theme" do - within '.application-theme' do - choose "Violet" - end - end - - step "I change my code preview theme" do - within '.code-preview-theme' do - choose "Solarized dark" - end - end - - step "I should see the theme change immediately" do - page.should have_selector('body.ui_color') - page.should_not have_selector('body.ui_basic') - end - - step "I should receive feedback that the changes were saved" do - page.should have_content("saved") - end - - step 'my password is expired' do - current_user.update_attributes(password_expires_at: Time.now - 1.hour) - end - - step "I am not an ldap user" do - current_user.identities.delete - current_user.ldap_user?.should be_false - end - - step 'I redirected to expired password page' do - current_path.should == new_profile_password_path - end - - step 'I submit new password' do - fill_in :user_current_password, with: '12345678' - fill_in :user_password, with: '12345678' - fill_in :user_password_confirmation, with: '12345678' - click_button "Set new password" - end - - step 'I redirected to sign in page' do - current_path.should == new_user_session_path - end - - step 'I should be redirected to password page' do - current_path.should == edit_profile_password_path - end - - step 'I should be redirected to account page' do - current_path.should == profile_account_path - end - - step 'I click on my profile picture' do - click_link 'profile-pic' - end - - step 'I should see my user page' do - page.should have_content "User Activity" - - within '.navbar-gitlab' do - page.should have_content current_user.name - end - end - - step 'I have group with projects' do - @group = create(:group) - @group.add_owner(current_user) - @project = create(:project, namespace: @group) - @event = create(:closed_issue_event, project: @project) - - @project.team << [current_user, :master] - end - - step 'I should see groups I belong to' do - page.should have_css('.profile-groups-avatars', visible: true) - end - - step 'I click on new application button' do - click_on 'New Application' - end - - step 'I should see application form' do - page.should have_content "New application" - end - - step 'I fill application form out and submit' do - fill_in :doorkeeper_application_name, with: 'test' - fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com' - click_on "Submit" - end - - step 'I see application' do - page.should have_content "Application: test" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click edit' do - click_on "Edit" - end - - step 'I see edit application form' do - page.should have_content "Edit application" - end - - step 'I change name of application and submit' do - page.should have_content "Edit application" - fill_in :doorkeeper_application_name, with: 'test_changed' - click_on "Submit" - end - - step 'I see that application was changed' do - page.should have_content "test_changed" - page.should have_content "Application Id" - page.should have_content "Secret" - end - - step 'I click to remove application' do - within '.oauth-applications' do - click_on "Destroy" - end - end - - step "I see that application is removed" do - page.find(".oauth-applications").should_not have_content "test_changed" - end -end diff --git a/features/steps/profile/ssh_keys.rb b/features/steps/profile/ssh_keys.rb deleted file mode 100644 index ea912e5b4da..00000000000 --- a/features/steps/profile/ssh_keys.rb +++ /dev/null @@ -1,46 +0,0 @@ -class Spinach::Features::ProfileSshKeys < Spinach::FeatureSteps - include SharedAuthentication - - step 'I should see my ssh keys' do - @user.keys.each do |key| - page.should have_content(key.title) - end - end - - step 'I click link "Add new"' do - click_link "Add SSH Key" - end - - step 'I submit new ssh key "Laptop"' do - fill_in "key_title", with: "Laptop" - fill_in "key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Add key" - end - - step 'I should see new ssh key "Laptop"' do - key = Key.find_by(title: "Laptop") - page.should have_content(key.title) - page.should have_content(key.key) - current_path.should == profile_key_path(key) - end - - step 'I click link "Work"' do - click_link "Work" - end - - step 'I click link "Remove"' do - click_link "Remove" - end - - step 'I visit profile keys page' do - visit profile_keys_path - end - - step 'I should not see "Work" ssh key' do - page.should_not have_content "Work" - end - - step 'I have ssh key "ssh-rsa Work"' do - create(:key, user: @user, title: "ssh-rsa Work", key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P Work") - end -end diff --git a/features/steps/project/active_tab.rb b/features/steps/project/active_tab.rb deleted file mode 100644 index dd3215adb1a..00000000000 --- a/features/steps/project/active_tab.rb +++ /dev/null @@ -1,103 +0,0 @@ -class Spinach::Features::ProjectActiveTab < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedActiveTab - include SharedProjectTab - - # Sub Tabs: Home - - step 'I click the "Team" tab' do - click_link('Members') - end - - step 'I click the "Attachments" tab' do - click_link('Attachments') - end - - step 'I click the "Snippets" tab' do - click_link('Snippets') - end - - step 'I click the "Edit" tab' do - within '.project-settings-nav' do - click_link('Project') - end - end - - step 'I click the "Hooks" tab' do - click_link('Web Hooks') - end - - step 'I click the "Deploy Keys" tab' do - click_link('Deploy Keys') - end - - step 'the active sub nav should be Team' do - ensure_active_sub_nav('Members') - end - - step 'the active sub nav should be Edit' do - ensure_active_sub_nav('Project') - end - - step 'the active sub nav should be Hooks' do - ensure_active_sub_nav('Web Hooks') - end - - step 'the active sub nav should be Deploy Keys' do - ensure_active_sub_nav('Deploy Keys') - end - - # Sub Tabs: Commits - - step 'I click the "Compare" tab' do - click_link('Compare') - end - - step 'I click the "Branches" tab' do - click_link('Branches') - end - - step 'I click the "Tags" tab' do - click_link('Tags') - end - - step 'the active sub tab should be Commits' do - ensure_active_sub_tab('Commits') - end - - step 'the active sub tab should be Compare' do - ensure_active_sub_tab('Compare') - end - - step 'the active sub tab should be Branches' do - ensure_active_sub_tab('Branches') - end - - step 'the active sub tab should be Tags' do - ensure_active_sub_tab('Tags') - end - - # Sub Tabs: Issues - - step 'I click the "Milestones" tab' do - click_link('Milestones') - end - - step 'I click the "Labels" tab' do - click_link('Labels') - end - - step 'the active sub tab should be Issues' do - ensure_active_sub_tab('Issues') - end - - step 'the active main tab should be Milestones' do - ensure_active_main_tab('Milestones') - end - - step 'the active main tab should be Labels' do - ensure_active_main_tab('Labels') - end -end diff --git a/features/steps/project/archived.rb b/features/steps/project/archived.rb deleted file mode 100644 index 37ad0c77655..00000000000 --- a/features/steps/project/archived.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Spinach::Features::ProjectArchived < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - When 'project "Forum" is archived' do - project = Project.find_by(name: "Forum") - project.update_attribute(:archived, true) - end - - When 'project "Shop" is archived' do - project = Project.find_by(name: "Shop") - project.update_attribute(:archived, true) - end - - When 'I visit project "Forum" page' do - project = Project.find_by(name: "Forum") - visit namespace_project_path(project.namespace, project) - end - - step 'I should not see "Archived"' do - page.should_not have_content "Archived" - end - - step 'I should see "Archived"' do - page.should have_content "Archived" - end - - When 'I set project archived' do - click_link "Archive" - end - - When 'I set project unarchived' do - click_link "Unarchive" - end - -end diff --git a/features/steps/project/commits/branches.rb b/features/steps/project/commits/branches.rb deleted file mode 100644 index 07f7e5796a3..00000000000 --- a/features/steps/project/commits/branches.rb +++ /dev/null @@ -1,85 +0,0 @@ -class Spinach::Features::ProjectCommitsBranches < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click link "All"' do - click_link "All" - end - - step 'I should see "Shop" all branches list' do - page.should have_content "Branches" - page.should have_content "master" - end - - step 'I click link "Protected"' do - click_link "Protected" - end - - step 'I should see "Shop" protected branches list' do - within ".protected-branches-list" do - page.should have_content "stable" - page.should_not have_content "master" - end - end - - step 'project "Shop" has protected branches' do - project = Project.find_by(name: "Shop") - project.protected_branches.create(name: "stable") - end - - step 'I click new branch link' do - click_link "New branch" - end - - step 'I submit new branch form' do - fill_in 'branch_name', with: 'deploy_keys' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I submit new branch form with invalid name' do - fill_in 'branch_name', with: '1.0 stable' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I submit new branch form with invalid reference' do - fill_in 'branch_name', with: 'foo' - fill_in 'ref', with: 'foo' - click_button 'Create branch' - end - - step 'I submit new branch form with branch that already exists' do - fill_in 'branch_name', with: 'master' - fill_in 'ref', with: 'master' - click_button 'Create branch' - end - - step 'I should see new branch created' do - page.should have_content 'deploy_keys' - end - - step 'I should see new an error that branch is invalid' do - page.should have_content 'Branch name invalid' - end - - step 'I should see new an error that ref is invalid' do - page.should have_content 'Invalid reference name' - end - - step 'I should see new an error that branch already exists' do - page.should have_content 'Branch already exists' - end - - step "I click branch 'improve/awesome' delete link" do - within '.js-branch-improve\/awesome' do - find('.btn-remove').click - sleep 0.05 - end - end - - step "I should not see branch 'improve/awesome'" do - all(visible: true).should_not have_content 'improve/awesome' - end -end diff --git a/features/steps/project/commits/comments.rb b/features/steps/project/commits/comments.rb deleted file mode 100644 index 3d4d8ad6368..00000000000 --- a/features/steps/project/commits/comments.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Spinach::Features::ProjectCommitsComments < Spinach::FeatureSteps - include SharedAuthentication - include SharedNote - include SharedPaths - include SharedProject -end diff --git a/features/steps/project/commits/commits.rb b/features/steps/project/commits/commits.rb deleted file mode 100644 index 57b727f837e..00000000000 --- a/features/steps/project/commits/commits.rb +++ /dev/null @@ -1,103 +0,0 @@ -class Spinach::Features::ProjectCommits < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RepoHelpers - - step 'I see project commits' do - commit = @project.repository.commit - page.should have_content(@project.name) - page.should have_content(commit.message[0..20]) - page.should have_content(commit.short_id) - end - - step 'I click atom feed link' do - click_link "Feed" - end - - step 'I see commits atom feed' do - commit = @project.repository.commit - response_headers['Content-Type'].should have_content("application/atom+xml") - body.should have_selector("title", text: "Recent commits to #{@project.name}") - body.should have_selector("author email", text: commit.author_email) - body.should have_selector("entry summary", text: commit.description[0..10]) - end - - step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) - end - - step 'I see commit info' do - page.should have_content sample_commit.message - page.should have_content "Showing #{sample_commit.files_changed_count} changed files" - end - - step 'I fill compare fields with refs' do - fill_in "from", with: sample_commit.parent_id - fill_in "to", with: sample_commit.id - click_button "Compare" - end - - step 'I unfold diff' do - @diff = first('.js-unfold') - @diff.click - sleep 2 - end - - step 'I should see additional file lines' do - within @diff.parent do - first('.new_line').text.should_not have_content "..." - end - end - - step 'I see compared refs' do - page.should have_content "Compare View" - page.should have_content "Commits (1)" - page.should have_content "Showing 2 changed files" - end - - step 'I see breadcrumb links' do - page.should have_selector('ul.breadcrumb') - page.should have_selector('ul.breadcrumb a', count: 4) - end - - step 'I see commits stats' do - page.should have_content 'Top 50 Committers' - page.should have_content 'Committers' - page.should have_content 'Total commits' - page.should have_content 'Authors' - end - - step 'I visit big commit page' do - Commit::DIFF_SAFE_FILES = 20 - visit namespace_project_commit_path(@project.namespace, @project, sample_big_commit.id) - end - - step 'I see big commit warning' do - page.should have_content sample_big_commit.message - page.should have_content "Too many changes" - Commit::DIFF_SAFE_FILES = 100 - end - - step 'I visit a commit with an image that changed' do - visit namespace_project_commit_path(@project.namespace, @project, sample_image_commit.id) - end - - step 'The diff links to both the previous and current image' do - links = all('.two-up span div a') - links[0]['href'].should =~ %r{blob/#{sample_image_commit.old_blob_id}} - links[1]['href'].should =~ %r{blob/#{sample_image_commit.new_blob_id}} - end - - step 'I click side-by-side diff button' do - click_link "Side-by-side" - end - - step 'I see side-by-side diff button' do - page.should have_content "Side-by-side" - end - - step 'I see inline diff button' do - page.should have_content "Inline" - end -end diff --git a/features/steps/project/commits/diff_comments.rb b/features/steps/project/commits/diff_comments.rb deleted file mode 100644 index b9d8cf2c5a5..00000000000 --- a/features/steps/project/commits/diff_comments.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Spinach::Features::ProjectCommitsDiffComments < Spinach::FeatureSteps - include SharedAuthentication - include SharedDiffNote - include SharedPaths - include SharedProject -end diff --git a/features/steps/project/commits/tags.rb b/features/steps/project/commits/tags.rb deleted file mode 100644 index 3465fcbfd07..00000000000 --- a/features/steps/project/commits/tags.rb +++ /dev/null @@ -1,82 +0,0 @@ -class Spinach::Features::ProjectCommitsTags < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I should see "Shop" all tags list' do - page.should have_content "Tags" - page.should have_content "v1.0.0" - end - - step 'I click new tag link' do - click_link 'New tag' - end - - step 'I submit new tag form' do - fill_in 'tag_name', with: 'v7.0' - fill_in 'ref', with: 'master' - click_button 'Create tag' - end - - step 'I submit new tag form with invalid name' do - fill_in 'tag_name', with: 'v 1.0' - fill_in 'ref', with: 'master' - click_button 'Create tag' - end - - step 'I submit new tag form with invalid reference' do - fill_in 'tag_name', with: 'foo' - fill_in 'ref', with: 'foo' - click_button 'Create tag' - end - - step 'I submit new tag form with tag that already exists' do - fill_in 'tag_name', with: 'v1.0.0' - fill_in 'ref', with: 'master' - click_button 'Create tag' - end - - step 'I should see new tag created' do - page.should have_content 'v7.0' - end - - step 'I should see new an error that tag is invalid' do - page.should have_content 'Tag name invalid' - end - - step 'I should see new an error that tag ref is invalid' do - page.should have_content 'Invalid reference name' - end - - step 'I should see new an error that tag already exists' do - page.should have_content 'Tag already exists' - end - - step "I delete tag 'v1.1.0'" do - within '.tags' do - first('.btn-remove').click - sleep 0.05 - end - end - - step "I should not see tag 'v1.1.0'" do - within '.tags' do - all(visible: true).should_not have_content 'v1.1.0' - end - end - - step 'I delete all tags' do - within '.tags' do - all('.btn-remove').each do |remove| - remove.click - sleep 0.05 - end - end - end - - step 'I should see tags info message' do - within '.tags' do - page.should have_content 'Repository has no tags yet.' - end - end -end diff --git a/features/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb deleted file mode 100644 index 63ff84c82ef..00000000000 --- a/features/steps/project/commits/user_lookup.rb +++ /dev/null @@ -1,48 +0,0 @@ -class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click on commit link' do - visit namespace_project_commit_path(@project.namespace, @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) - end - - step 'I have user with primary email' do - user_primary - end - - step 'I have user with secondary email' do - user_secondary - end - - step 'I see author based on primary email' do - check_author_link(sample_commit.author_email, user_primary) - end - - step 'I see author based on secondary email' do - check_author_link(sample_commit.author_email, user_secondary) - end - - def check_author_link(email, user) - author_link = find('.commit-author-link') - author_link['href'].should == user_path(user) - author_link['data-original-title'].should == email - find('.commit-author-name').text.should == user.name - end - - def user_primary - @user_primary ||= create(:user, email: 'dmitriy.zaporozhets@gmail.com') - end - - def user_secondary - @user_secondary ||= begin - user = create(:user, email: 'dzaporozhets@example.com') - create(:email, { user: user, email: 'dmitriy.zaporozhets@gmail.com' }) - user - end - end -end diff --git a/features/steps/project/create.rb b/features/steps/project/create.rb deleted file mode 100644 index 6b85cf74f5f..00000000000 --- a/features/steps/project/create.rb +++ /dev/null @@ -1,42 +0,0 @@ -class Spinach::Features::ProjectCreate < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - - step 'fill project form with valid data' do - fill_in 'project_path', with: 'Empty' - click_button "Create project" - end - - step 'I should see project page' do - page.should have_content "Empty" - current_path.should == namespace_project_path(Project.last.namespace, Project.last) - end - - step 'I should see empty project instuctions' do - page.should have_content "git init" - page.should have_content "git remote" - page.should have_content Project.last.url_to_repo - end - - step 'I see empty project instuctions' do - page.should have_content "git init" - page.should have_content "git remote" - page.should have_content Project.last.url_to_repo - end - - step 'I click on HTTP' do - click_button 'HTTP' - end - - step 'Remote url should update to http link' do - page.should have_content "git remote add origin #{Project.last.http_url_to_repo}" - end - - step 'If I click on SSH' do - click_button 'SSH' - end - - step 'Remote url should update to ssh link' do - page.should have_content "git remote add origin #{Project.last.url_to_repo}" - end -end diff --git a/features/steps/project/deploy_keys.rb b/features/steps/project/deploy_keys.rb deleted file mode 100644 index 50e14513a7a..00000000000 --- a/features/steps/project/deploy_keys.rb +++ /dev/null @@ -1,77 +0,0 @@ -class Spinach::Features::ProjectDeployKeys < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'project has deploy key' do - create(:deploy_keys_project, project: @project) - end - - step 'I should see project deploy key' do - within '.enabled-keys' do - page.should have_content deploy_key.title - end - end - - step 'I should see other project deploy key' do - within '.available-keys' do - page.should have_content other_deploy_key.title - end - end - - step 'I should see public deploy key' do - within '.available-keys' do - page.should have_content public_deploy_key.title - end - end - - step 'I click \'New Deploy Key\'' do - click_link 'New Deploy Key' - end - - step 'I submit new deploy key' do - fill_in "deploy_key_title", with: "laptop" - fill_in "deploy_key_key", with: "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzrEJUIR6Y03TCE9rIJ+GqTBvgb8t1jI9h5UBzCLuK4VawOmkLornPqLDrGbm6tcwM/wBrrLvVOqi2HwmkKEIecVO0a64A4rIYScVsXIniHRS6w5twyn1MD3sIbN+socBDcaldECQa2u1dI3tnNVcs8wi77fiRe7RSxePsJceGoheRQgC8AZ510UdIlO+9rjIHUdVN7LLyz512auAfYsgx1OfablkQ/XJcdEwDNgi9imI6nAXhmoKUm1IPLT2yKajTIC64AjLOnE0YyCh6+7RFMpiMyu1qiOCpdjYwTgBRiciNRZCH8xIedyCoAmiUgkUT40XYHwLuwiPJICpkAzp7Q== user@laptop" - click_button "Create" - end - - step 'I should be on deploy keys page' do - current_path.should == namespace_project_deploy_keys_path(@project.namespace, @project) - end - - step 'I should see newly created deploy key' do - within '.enabled-keys' do - page.should have_content(deploy_key.title) - end - end - - step 'other project has deploy key' do - @second_project = create :project, namespace: create(:group) - @second_project.team << [current_user, :master] - create(:deploy_keys_project, project: @second_project) - end - - step 'public deploy key exists' do - create(:deploy_key, public: true) - end - - step 'I click attach deploy key' do - within '.available-keys' do - click_link 'Enable' - end - end - - protected - - def deploy_key - @project.deploy_keys.last - end - - def other_deploy_key - @second_project.deploy_keys.last - end - - def public_deploy_key - DeployKey.are_public.last - end -end diff --git a/features/steps/project/fork.rb b/features/steps/project/fork.rb deleted file mode 100644 index 8e58597db20..00000000000 --- a/features/steps/project/fork.rb +++ /dev/null @@ -1,34 +0,0 @@ -class Spinach::Features::ProjectFork < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I click link "Fork"' do - page.should have_content "Shop" - page.should have_content "Fork" - click_link "Fork" - end - - step 'I am a member of project "Shop"' do - @project = create(:project, name: "Shop") - @project.team << [@user, :reporter] - end - - step 'I should see the forked project page' do - page.should have_content "Project was successfully forked." - end - - step 'I already have a project named "Shop" in my namespace' do - @my_project = create(:project, name: "Shop", namespace: current_user.namespace) - end - - step 'I should see a "Name has already been taken" warning' do - page.should have_content "Name has already been taken" - end - - step 'I fork to my namespace' do - within '.fork-namespaces' do - click_link current_user.name - end - end -end diff --git a/features/steps/project/forked_merge_requests.rb b/features/steps/project/forked_merge_requests.rb deleted file mode 100644 index 63ad90e1241..00000000000 --- a/features/steps/project/forked_merge_requests.rb +++ /dev/null @@ -1,136 +0,0 @@ -class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedNote - include SharedPaths - include Select2Helper - - step 'I am a member of project "Shop"' do - @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop") - @project.team << [@user, :reporter] - @project.ensure_satellite_exists - end - - step 'I have a project forked off of "Shop" called "Forked Shop"' do - @forked_project = Projects::ForkService.new(@project, @user).execute - end - - step 'I click link "New Merge Request"' do - click_link "New Merge Request" - end - - step 'I should see merge request "Merge Request On Forked Project"' do - @project.merge_requests.size.should >= 1 - @merge_request = @project.merge_requests.last - current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - @merge_request.title.should == "Merge Request On Forked Project" - @merge_request.source_project.should == @forked_project - @merge_request.source_branch.should == "fix" - @merge_request.target_branch.should == "master" - page.should have_content @forked_project.path_with_namespace - page.should have_content @project.path_with_namespace - page.should have_content @merge_request.source_branch - page.should have_content @merge_request.target_branch - end - - step 'I fill out a "Merge Request On Forked Project" merge request' do - select @forked_project.path_with_namespace, from: "merge_request_source_project_id" - select @project.path_with_namespace, from: "merge_request_target_project_id" - select "fix", from: "merge_request_source_branch" - select "master", from: "merge_request_target_branch" - - click_button "Compare branches" - - fill_in "merge_request_title", with: "Merge Request On Forked Project" - end - - step 'I submit the merge request' do - click_button "Submit merge request" - end - - step 'I follow the target commit link' do - commit = @project.repository.commit - click_link commit.short_id(8) - end - - step 'I should see the commit under the forked from project' do - commit = @project.repository.commit - page.should have_content(commit.message) - end - - step 'I click "Create Merge Request on fork" link' do - click_link "Create Merge Request on fork" - end - - step 'I see prefilled new Merge Request page for the forked project' do - current_path.should == new_namespace_project_merge_request_path(@forked_project.namespace, @forked_project) - find("#merge_request_source_project_id").value.should == @forked_project.id.to_s - find("#merge_request_target_project_id").value.should == @project.id.to_s - find("#merge_request_source_branch").value.should have_content "new_design" - find("#merge_request_target_branch").value.should have_content "master" - find("#merge_request_title").value.should == "New Design" - verify_commit_link(".mr_target_commit", @project) - verify_commit_link(".mr_source_commit", @forked_project) - end - - step 'I update the merge request title' do - fill_in "merge_request_title", with: "An Edited Forked Merge Request" - end - - step 'I save the merge request' do - click_button "Save changes" - end - - step 'I should see the edited merge request' do - page.should have_content "An Edited Forked Merge Request" - @project.merge_requests.size.should >= 1 - @merge_request = @project.merge_requests.last - current_path.should == namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - @merge_request.source_project.should == @forked_project - @merge_request.source_branch.should == "fix" - @merge_request.target_branch.should == "master" - page.should have_content @forked_project.path_with_namespace - page.should have_content @project.path_with_namespace - page.should have_content @merge_request.source_branch - page.should have_content @merge_request.target_branch - end - - step 'I should see last push widget' do - page.should have_content "You pushed to new_design" - page.should have_link "Create Merge Request" - end - - step 'I click link edit "Merge Request On Forked Project"' do - find("#edit_merge_request").click - end - - step 'I see the edit page prefilled for "Merge Request On Forked Project"' do - current_path.should == edit_namespace_project_merge_request_path(@project.namespace, @project, @merge_request) - page.should have_content "Edit merge request ##{@merge_request.id}" - find("#merge_request_title").value.should == "Merge Request On Forked Project" - end - - step 'I fill out an invalid "Merge Request On Forked Project" merge request' do - select "Select branch", from: "merge_request_target_branch" - find(:select, "merge_request_source_project_id", {}).value.should == @forked_project.id.to_s - find(:select, "merge_request_target_project_id", {}).value.should == @project.id.to_s - find(:select, "merge_request_source_branch", {}).value.should == "" - find(:select, "merge_request_target_branch", {}).value.should == "" - click_button "Compare branches" - end - - step 'I should see validation errors' do - page.should have_content "You must select source and target branch" - end - - step 'the target repository should be the original repository' do - page.should have_select("merge_request_target_project_id", selected: @project.path_with_namespace) - end - - # Verify a link is generated against the correct project - def verify_commit_link(container_div, container_project) - # This should force a wait for the javascript to execute - find(:div,container_div).find(".commit_short_id")['href'].should have_content "#{container_project.path_with_namespace}/commit" - end -end diff --git a/features/steps/project/graph.rb b/features/steps/project/graph.rb deleted file mode 100644 index a2807c340f6..00000000000 --- a/features/steps/project/graph.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Spinach::Features::ProjectGraph < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - - step 'page should have graphs' do - page.should have_selector ".stat-graph" - end - - When 'I visit project "Shop" graph page' do - project = Project.find_by(name: "Shop") - visit namespace_project_graph_path(project.namespace, project, "master") - end - - step 'I visit project "Shop" commits graph page' do - project = Project.find_by(name: "Shop") - visit commits_namespace_project_graph_path(project.namespace, project, "master") - end - - step 'page should have commits graphs' do - page.should have_content "Commit statistics for master" - page.should have_content "Commits per day of month" - end -end diff --git a/features/steps/project/hooks.rb b/features/steps/project/hooks.rb deleted file mode 100644 index 4b135202593..00000000000 --- a/features/steps/project/hooks.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'webmock' - -class Spinach::Features::ProjectHooks < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RSpec::Matchers - include RSpec::Mocks::ExampleMethods - include WebMock::API - - step 'project has hook' do - @hook = create(:project_hook, project: current_project) - end - - step 'I own empty project with hook' do - @project = create(:empty_project, - name: 'Empty Project', namespace: @user.namespace) - @hook = create(:project_hook, project: current_project) - end - - step 'I should see project hook' do - page.should have_content @hook.url - end - - step 'I submit new hook' do - @url = Faker::Internet.uri("http") - fill_in "hook_url", with: @url - expect { click_button "Add Web Hook" }.to change(ProjectHook, :count).by(1) - end - - step 'I should see newly created hook' do - current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) - page.should have_content(@url) - end - - step 'I click test hook button' do - stub_request(:post, @hook.url).to_return(status: 200) - click_link 'Test Hook' - end - - step 'I click test hook button with invalid URL' do - stub_request(:post, @hook.url).to_raise(SocketError) - click_link 'Test Hook' - end - - step 'hook should be triggered' do - current_path.should == namespace_project_hooks_path(current_project.namespace, current_project) - page.should have_selector '.flash-notice', - text: 'Hook successfully executed.' - end - - step 'I should see hook error message' do - page.should have_selector '.flash-alert', - text: 'Hook execution failed. '\ - 'Ensure the project has commits.' - end - - step 'I should see hook service down error message' do - page.should have_selector '.flash-alert', - text: 'Hook execution failed. '\ - 'Ensure hook URL is correct and '\ - 'service is up.' - end -end diff --git a/features/steps/project/issues/filter_labels.rb b/features/steps/project/issues/filter_labels.rb deleted file mode 100644 index 5740bd12837..00000000000 --- a/features/steps/project/issues/filter_labels.rb +++ /dev/null @@ -1,60 +0,0 @@ -class Spinach::Features::ProjectIssuesFilterLabels < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include Select2Helper - - step 'I should see "Bugfix1" in issues list' do - within ".issues-list" do - page.should have_content "Bugfix1" - end - end - - step 'I should see "Bugfix2" in issues list' do - within ".issues-list" do - page.should have_content "Bugfix2" - end - end - - step 'I should not see "Bugfix2" in issues list' do - within ".issues-list" do - page.should_not have_content "Bugfix2" - end - end - - step 'I should not see "Feature1" in issues list' do - within ".issues-list" do - page.should_not have_content "Feature1" - end - end - - step 'I click link "bug"' do - select2('bug', from: "#label_name") - end - - step 'I click link "feature"' do - within ".labels-filter" do - click_link "feature" - end - end - - step 'project "Shop" has issue "Bugfix1" with labels: "bug", "feature"' do - project = Project.find_by(name: "Shop") - issue = create(:issue, title: "Bugfix1", project: project) - issue.labels << project.labels.find_by(title: 'bug') - issue.labels << project.labels.find_by(title: 'feature') - end - - step 'project "Shop" has issue "Bugfix2" with labels: "bug", "enhancement"' do - project = Project.find_by(name: "Shop") - issue = create(:issue, title: "Bugfix2", project: project) - issue.labels << project.labels.find_by(title: 'bug') - issue.labels << project.labels.find_by(title: 'enhancement') - end - - step 'project "Shop" has issue "Feature1" with labels: "feature"' do - project = Project.find_by(name: "Shop") - issue = create(:issue, title: "Feature1", project: project) - issue.labels << project.labels.find_by(title: 'feature') - end -end diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb deleted file mode 100644 index b8e282b2029..00000000000 --- a/features/steps/project/issues/issues.rb +++ /dev/null @@ -1,276 +0,0 @@ -class Spinach::Features::ProjectIssues < Spinach::FeatureSteps - include SharedAuthentication - include SharedIssuable - include SharedProject - include SharedNote - include SharedPaths - include SharedMarkdown - - step 'I should see "Release 0.4" in issues' do - page.should have_content "Release 0.4" - end - - step 'I should not see "Release 0.3" in issues' do - page.should_not have_content "Release 0.3" - end - - step 'I should not see "Tweet control" in issues' do - page.should_not have_content "Tweet control" - end - - step 'I should see that I am subscribed' do - find(".subscribe-button span").text.should == "Unsubscribe" - end - - step 'I should see that I am unsubscribed' do - sleep 0.2 - find(".subscribe-button span").text.should == "Subscribe" - end - - step 'I click link "Closed"' do - click_link "Closed" - end - - step 'I click button "Unsubscribe"' do - click_on "Unsubscribe" - end - - step 'I should see "Release 0.3" in issues' do - page.should have_content "Release 0.3" - end - - step 'I should not see "Release 0.4" in issues' do - page.should_not have_content "Release 0.4" - end - - step 'I click link "All"' do - click_link "All" - end - - step 'I click link "Release 0.4"' do - click_link "Release 0.4" - end - - step 'I should see issue "Release 0.4"' do - page.should have_content "Release 0.4" - end - - step 'I click link "New Issue"' do - click_link "New Issue" - end - - step 'I click "author" dropdown' do - first('.ajax-users-select').click - end - - step 'I see current user as the first user' do - expect(page).to have_selector('.user-result', visible: true, count: 4) - users = page.all('.user-name') - users[0].text.should == 'Any' - users[1].text.should == 'Unassigned' - users[2].text.should == current_user.name - end - - step 'I submit new issue "500 error on profile"' do - fill_in "issue_title", with: "500 error on profile" - click_button "Submit new issue" - end - - step 'I submit new issue "500 error on profile" with label \'bug\'' do - fill_in "issue_title", with: "500 error on profile" - select 'bug', from: "Labels" - click_button "Submit new issue" - end - - step 'I click link "500 error on profile"' do - click_link "500 error on profile" - end - - step 'I should see label \'bug\' with issue' do - within '.issue-show-labels' do - page.should have_content 'bug' - end - end - - step 'I should see issue "500 error on profile"' do - issue = Issue.find_by(title: "500 error on profile") - page.should have_content issue.title - page.should have_content issue.author_name - page.should have_content issue.project.name - end - - step 'I fill in issue search with "Re"' do - filter_issue "Re" - end - - step 'I fill in issue search with "Bu"' do - filter_issue "Bu" - end - - step 'I fill in issue search with ".3"' do - filter_issue ".3" - end - - step 'I fill in issue search with "Something"' do - filter_issue "Something" - end - - step 'I fill in issue search with ""' do - filter_issue "" - end - - step 'project "Shop" has milestone "v2.2"' do - - milestone = create(:milestone, title: "v2.2", project: project) - - 3.times { create(:issue, project: project, milestone: milestone) } - end - - step 'project "Shop" has milestone "v3.0"' do - - milestone = create(:milestone, title: "v3.0", project: project) - - 3.times { create(:issue, project: project, milestone: milestone) } - end - - When 'I select milestone "v3.0"' do - select "v3.0", from: "milestone_id" - end - - step 'I should see selected milestone with title "v3.0"' do - issues_milestone_selector = "#issue_milestone_id_chzn > a" - find(issues_milestone_selector).should have_content("v3.0") - end - - When 'I select first assignee from "Shop" project' do - - first_assignee = project.users.first - select first_assignee.name, from: "assignee_id" - end - - step 'I should see first assignee from "Shop" as selected assignee' do - issues_assignee_selector = "#issue_assignee_id_chzn > a" - - assignee_name = project.users.first.name - find(issues_assignee_selector).should have_content(assignee_name) - end - - step 'project "Shop" have "Release 0.4" open issue' do - - create(:issue, - title: "Release 0.4", - project: project, - author: project.users.first, - description: "# Description header" - ) - end - - step 'project "Shop" have "Tweet control" open issue' do - create(:issue, - title: "Tweet control", - project: project, - author: project.users.first) - end - - step 'project "Shop" have "Release 0.3" closed issue' do - create(:closed_issue, - title: "Release 0.3", - project: project, - author: project.users.first) - end - - step 'project "Shop" has "Tasks-open" open issue with task markdown' do - create_taskable(:issue, 'Tasks-open') - end - - step 'project "Shop" has "Tasks-closed" closed issue with task markdown' do - create_taskable(:closed_issue, 'Tasks-closed') - end - - step 'empty project "Empty Project"' do - create :empty_project, name: 'Empty Project', namespace: @user.namespace - end - - When 'I visit empty project page' do - project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) - end - - step 'I see empty project details with ssh clone info' do - project = Project.find_by(name: 'Empty Project') - all(:css, '.git-empty .clone').each do |element| - element.text.should include(project.url_to_repo) - end - 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) - end - - step 'I leave a comment with code block' do - within(".js-main-target-form") do - fill_in "note[note]", with: "```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```" - click_button "Add Comment" - sleep 0.05 - end - end - - step 'I should see an error alert section within the comment form' do - within(".js-main-target-form") do - find(".error-alert") - end - end - - step 'The code block should be unchanged' do - page.should have_content("```\nCommand [1]: /usr/local/bin/git , see [text](doc/text)\n```") - end - - step 'project \'Shop\' has issue \'Bugfix1\' with description: \'Description for issue1\'' do - issue = create(:issue, title: 'Bugfix1', description: 'Description for issue1', project: project) - end - - step 'project \'Shop\' has issue \'Feature1\' with description: \'Feature submitted for issue1\'' do - issue = create(:issue, title: 'Feature1', description: 'Feature submitted for issue1', project: project) - end - - step 'I fill in issue search with \'Description for issue1\'' do - filter_issue 'Description for issue' - end - - step 'I fill in issue search with \'issue1\'' do - filter_issue 'issue1' - end - - step 'I fill in issue search with \'Rock and roll\'' do - filter_issue 'Description for issue' - end - - step 'I should see \'Bugfix1\' in issues' do - page.should have_content 'Bugfix1' - end - - step 'I should see \'Feature1\' in issues' do - page.should have_content 'Feature1' - end - - step 'I should not see \'Bugfix1\' in issues' do - page.should_not have_content 'Bugfix1' - end - - step 'issue \'Release 0.4\' has label \'bug\'' do - label = project.labels.create!(name: 'bug', color: '#990000') - issue = Issue.find_by!(title: 'Release 0.4') - issue.labels << label - end - - step 'I click label \'bug\'' do - within ".issues-list" do - click_link 'bug' - end - end - - def filter_issue(text) - fill_in 'issue_search', with: text - end -end diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb deleted file mode 100644 index 6ce34c500c6..00000000000 --- a/features/steps/project/issues/labels.rb +++ /dev/null @@ -1,101 +0,0 @@ -class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I visit \'bug\' label edit page' do - visit edit_namespace_project_label_path(project.namespace, project, bug_label) - end - - step 'I remove label \'bug\'' do - within "#label_#{bug_label.id}" do - click_link 'Remove' - end - end - - step 'I delete all labels' do - within '.labels' do - all('.btn-remove').each do |remove| - remove.click - sleep 0.05 - end - end - end - - step 'I should see labels help message' do - within '.labels' do - page.should have_content 'Create first label or generate default set of '\ - 'labels' - end - end - - step 'I submit new label \'support\'' do - fill_in 'Title', with: 'support' - fill_in 'Background Color', with: '#F95610' - click_button 'Save' - end - - step 'I submit new label \'bug\'' do - fill_in 'Title', with: 'bug' - fill_in 'Background Color', with: '#F95610' - click_button 'Save' - end - - step 'I submit new label with invalid color' do - fill_in 'Title', with: 'support' - fill_in 'Background Color', with: '#12' - click_button 'Save' - end - - step 'I should see label label exist error message' do - within '.label-form' do - page.should have_content 'Title has already been taken' - end - end - - step 'I should see label color error message' do - within '.label-form' do - page.should have_content 'Color is invalid' - end - end - - step 'I should see label \'feature\'' do - within '.manage-labels-list' do - page.should have_content 'feature' - end - end - - step 'I should see label \'bug\'' do - within '.manage-labels-list' do - page.should have_content 'bug' - end - end - - step 'I should not see label \'bug\'' do - within '.manage-labels-list' do - page.should_not have_content 'bug' - end - end - - step 'I should see label \'support\'' do - within '.manage-labels-list' do - page.should have_content 'support' - end - end - - step 'I change label \'bug\' to \'fix\'' do - fill_in 'Title', with: 'fix' - fill_in 'Background Color', with: '#F15610' - click_button 'Save' - end - - step 'I should see label \'fix\'' do - within '.manage-labels-list' do - page.should have_content 'fix' - end - end - - def bug_label - project.labels.find_or_create_by(title: 'bug') - end -end diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb deleted file mode 100644 index cce87a6d981..00000000000 --- a/features/steps/project/issues/milestones.rb +++ /dev/null @@ -1,59 +0,0 @@ -class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include SharedMarkdown - - step 'I should see milestone "v2.2"' do - milestone = @project.milestones.find_by(title: "v2.2") - page.should have_content(milestone.title[0..10]) - page.should have_content(milestone.expires_at) - page.should have_content("Issues") - end - - step 'I click link "v2.2"' do - click_link "v2.2" - end - - step 'I click link "New Milestone"' do - click_link "New Milestone" - end - - step 'I submit new milestone "v2.3"' do - fill_in "milestone_title", with: "v2.3" - click_button "Create milestone" - end - - step 'I should see milestone "v2.3"' do - milestone = @project.milestones.find_by(title: "v2.3") - page.should have_content(milestone.title[0..10]) - page.should have_content(milestone.expires_at) - page.should have_content("Issues") - end - - step 'project "Shop" has milestone "v2.2"' do - project = Project.find_by(name: "Shop") - milestone = create(:milestone, - title: "v2.2", - project: project, - description: "# Description header" - ) - 3.times { create(:issue, project: project, milestone: milestone) } - end - - step 'the milestone has open and closed issues' do - project = Project.find_by(name: "Shop") - milestone = project.milestones.find_by(title: 'v2.2') - - # 3 Open issues created above; create one closed issue - create(:closed_issue, project: project, milestone: milestone) - end - - When 'I click link "All Issues"' do - click_link 'All Issues' - end - - step 'I should see 3 issues' do - page.should have_selector('#tab-issues li.issue-row', count: 4) - end -end diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb deleted file mode 100644 index bb1f9f129c0..00000000000 --- a/features/steps/project/merge_requests.rb +++ /dev/null @@ -1,337 +0,0 @@ -class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps - include SharedAuthentication - include SharedIssuable - include SharedProject - include SharedNote - include SharedPaths - include SharedMarkdown - include SharedDiffNote - - step 'I click link "New Merge Request"' do - click_link "New Merge Request" - end - - step 'I click link "Bug NS-04"' do - click_link "Bug NS-04" - end - - step 'I click link "All"' do - click_link "All" - end - - step 'I click link "Closed"' do - click_link "Closed" - end - - step 'I should see merge request "Wiki Feature"' do - within '.merge-request' do - page.should have_content "Wiki Feature" - end - end - - step 'I should see closed merge request "Bug NS-04"' do - merge_request = MergeRequest.find_by!(title: "Bug NS-04") - merge_request.closed?.should be_true - page.should have_content "Closed by" - end - - step 'I should see merge request "Bug NS-04"' do - page.should have_content "Bug NS-04" - end - - step 'I should see "Bug NS-04" in merge requests' do - page.should have_content "Bug NS-04" - end - - step 'I should see "Feature NS-03" in merge requests' do - page.should have_content "Feature NS-03" - end - - step 'I should not see "Feature NS-03" in merge requests' do - page.should_not have_content "Feature NS-03" - end - - - step 'I should not see "Bug NS-04" in merge requests' do - page.should_not have_content "Bug NS-04" - end - - step 'I should see that I am subscribed' do - find(".subscribe-button span").text.should == "Unsubscribe" - end - - step 'I should see that I am unsubscribed' do - find(".subscribe-button span").should have_content("Subscribe") - end - - step 'I click button "Unsubscribe"' do - click_on "Unsubscribe" - end - - step 'I click link "Close"' do - first(:css, '.close-mr-link').click - end - - step 'I submit new merge request "Wiki Feature"' do - select "fix", from: "merge_request_source_branch" - select "feature", from: "merge_request_target_branch" - click_button "Compare branches" - fill_in "merge_request_title", with: "Wiki Feature" - click_button "Submit merge request" - end - - step 'project "Shop" have "Bug NS-04" open merge request' do - create(:merge_request, - title: "Bug NS-04", - source_project: project, - target_project: project, - source_branch: 'fix', - target_branch: 'master', - author: project.users.first, - description: "# Description header" - ) - end - - step 'project "Shop" have "Bug NS-05" open merge request with diffs inside' do - create(:merge_request_with_diffs, - title: "Bug NS-05", - source_project: project, - target_project: project, - author: project.users.first) - end - - step 'project "Shop" have "Feature NS-03" closed merge request' do - create(:closed_merge_request, - title: "Feature NS-03", - source_project: project, - target_project: project, - author: project.users.first) - end - - step 'project "Shop" has "MR-task-open" open MR with task markdown' do - create_taskable(:merge_request, 'MR-task-open') - end - - step 'I switch to the diff tab' do - visit diffs_namespace_project_merge_request_path(project.namespace, project, merge_request) - end - - step 'I click on the Changes tab via Javascript' do - find('.diffs-tab').click - sleep 2 - end - - step 'I should see the proper Inline and Side-by-side links' do - buttons = all('#commit-diff-viewtype') - expect(buttons.count).to eq(2) - - buttons.each do |b| - expect(b['href']).should_not have_content('json') - end - end - - step 'I switch to the merge request\'s comments tab' do - visit namespace_project_merge_request_path(project.namespace, project, merge_request) - end - - step 'I click on the commit in the merge request' do - within '.merge-request-tabs' do - click_link 'Commits' - end - - within '.commits' do - click_link Commit.truncate_sha(sample_commit.id) - end - end - - step 'I leave a comment on the diff page' do - init_diff_note - leave_comment "One comment to rule them all" - end - - step 'I leave a comment on the diff page in commit' do - click_diff_line(sample_commit.line_code) - leave_comment "One comment to rule them all" - end - - step 'I leave a comment like "Line is wrong" on diff' do - init_diff_note - leave_comment "Line is wrong" - end - - step 'I leave a comment like "Line is wrong" on diff in commit' do - click_diff_line(sample_commit.line_code) - leave_comment "Line is wrong" - end - - step 'I should see a discussion has started on diff' do - page.should have_content "#{current_user.name} started a discussion" - page.should have_content sample_commit.line_code_path - page.should have_content "Line is wrong" - end - - step 'I should see a discussion has started on commit diff' do - page.should have_content "#{current_user.name} started a discussion on commit" - page.should have_content sample_commit.line_code_path - page.should have_content "Line is wrong" - end - - step 'I should see a discussion has started on commit' do - page.should have_content "#{current_user.name} started a discussion on commit" - page.should have_content "One comment to rule them all" - end - - step 'merge request is mergeable' do - page.should have_button 'Accept Merge Request' - end - - step 'I modify merge commit message' do - find('.modify-merge-commit-link').click - fill_in 'commit_message', with: 'wow such merge' - end - - step 'merge request "Bug NS-05" is mergeable' do - merge_request.mark_as_mergeable - end - - step 'I accept this merge request' do - Gitlab::Satellite::MergeAction.any_instance.stub( - merge!: true, - ) - - within '.can_be_merged' do - click_button "Accept Merge Request" - end - end - - step 'I should see merged request' do - within '.issue-box' do - page.should have_content "Merged" - end - end - - step 'I click link "Reopen"' do - first(:css, '.reopen-mr-link').click - end - - step 'I should see reopened merge request "Bug NS-04"' do - within '.issue-box' do - page.should have_content "Open" - end - end - - step 'I click link "Hide inline discussion" of the second file' do - within '.files [id^=diff]:nth-child(2)' do - find('.js-toggle-diff-comments').click - end - end - - step 'I click link "Show inline discussion" of the second file' do - within '.files [id^=diff]:nth-child(2)' do - find('.js-toggle-diff-comments').click - end - end - - step 'I should not see a comment like "Line is wrong" in the second file' do - within '.files [id^=diff]:nth-child(2)' do - page.should_not have_visible_content "Line is wrong" - end - end - - step 'I should see a comment like "Line is wrong" in the second file' do - within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do - page.should have_visible_content "Line is wrong" - end - end - - step 'I should not see a comment like "Line is wrong here" in the second file' do - within '.files [id^=diff]:nth-child(2)' do - page.should_not have_visible_content "Line is wrong here" - end - end - - step 'I should see a comment like "Line is wrong here" in the second file' do - within '.files [id^=diff]:nth-child(2) .note-body > .note-text' do - page.should have_visible_content "Line is wrong here" - end - end - - step 'I leave a comment like "Line is correct" on line 12 of the first file' do - init_diff_note_first_file - - within(".js-discussion-note-form") do - fill_in "note_note", with: "Line is correct" - click_button "Add Comment" - end - - within ".files [id^=diff]:nth-child(1) .note-body > .note-text" do - page.should have_content "Line is correct" - end - end - - step 'I leave a comment like "Line is wrong" on line 39 of the second file' do - init_diff_note_second_file - - within(".js-discussion-note-form") do - fill_in "note_note", with: "Line is wrong on here" - click_button "Add Comment" - end - end - - step 'I should still see a comment like "Line is correct" in the first file' do - within '.files [id^=diff]:nth-child(1) .note-body > .note-text' do - page.should have_visible_content "Line is correct" - end - end - - step 'I unfold diff' do - first('.js-unfold').click - end - - step 'I should see additional file lines' do - expect(first('.text-file')).to have_content('.bundle') - end - - step 'I click Side-by-side Diff tab' do - find('a', text: 'Side-by-side').trigger('click') - end - - step 'I should see comments on the side-by-side diff page' do - within '.files [id^=diff]:nth-child(1) .parallel .note-body > .note-text' do - page.should have_visible_content "Line is correct" - end - end - - step 'I fill in merge request search with "Fe"' do - fill_in 'issue_search', with: "Fe" - end - - def merge_request - @merge_request ||= MergeRequest.find_by!(title: "Bug NS-05") - end - - def init_diff_note - click_diff_line(sample_commit.line_code) - end - - def leave_comment(message) - within(".js-discussion-note-form") do - fill_in "note_note", with: message - click_button "Add Comment" - end - - page.should have_content message - end - - def init_diff_note_first_file - click_diff_line(sample_compare.changes[0][:line_code]) - end - - def init_diff_note_second_file - click_diff_line(sample_compare.changes[1][:line_code]) - end - - def have_visible_content (text) - have_css("*", text: text, visible: true) - end -end diff --git a/features/steps/project/network_graph.rb b/features/steps/project/network_graph.rb deleted file mode 100644 index a15688ace6a..00000000000 --- a/features/steps/project/network_graph.rb +++ /dev/null @@ -1,93 +0,0 @@ -class Spinach::Features::ProjectNetworkGraph < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'page should have network graph' do - page.should have_selector ".network-graph" - end - - When 'I visit project "Shop" network page' do - # Stub Graph max_size to speed up test (10 commits vs. 650) - Network::Graph.stub(max_count: 10) - - project = Project.find_by(name: "Shop") - visit namespace_project_network_path(project.namespace, project, "master") - end - - step 'page should select "master" in select box' do - page.should have_selector '.select2-chosen', text: "master" - end - - step 'page should select "v1.0.0" in select box' do - page.should have_selector '.select2-chosen', text: "v1.0.0" - end - - step 'page should have "master" on graph' do - within '.network-graph' do - page.should have_content 'master' - end - end - - When 'I switch ref to "feature"' do - select 'feature', from: 'ref' - sleep 2 - end - - When 'I switch ref to "v1.0.0"' do - select 'v1.0.0', from: 'ref' - sleep 2 - end - - When 'click "Show only selected branch" checkbox' do - find('#filter_ref').click - sleep 2 - end - - step 'page should have content not containing "v1.0.0"' do - within '.network-graph' do - page.should have_content 'Change some files' - end - end - - step 'page should not have content not containing "v1.0.0"' do - within '.network-graph' do - page.should_not have_content 'Change some files' - end - end - - step 'page should select "feature" in select box' do - page.should have_selector '.select2-chosen', text: "feature" - end - - step 'page should select "v1.0.0" in select box' do - page.should have_selector '.select2-chosen', text: "v1.0.0" - end - - step 'page should have "feature" on graph' do - within '.network-graph' do - page.should have_content 'feature' - end - end - - When 'I looking for a commit by SHA of "v1.0.0"' do - within ".network-form" do - fill_in 'extended_sha1', with: '6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9' - find('button').click - end - sleep 2 - end - - step 'page should have "v1.0.0" on graph' do - within '.network-graph' do - page.should have_content 'v1.0.0' - end - end - - When 'I look for a commit by ";"' do - within ".network-form" do - fill_in 'extended_sha1', with: ';' - find('button').click - end - end -end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb deleted file mode 100644 index d39c8e7d2db..00000000000 --- a/features/steps/project/project.rb +++ /dev/null @@ -1,97 +0,0 @@ -class Spinach::Features::Project < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'change project settings' do - fill_in 'project_name_edit', with: 'NewName' - uncheck 'project_issues_enabled' - end - - step 'I save project' do - click_button 'Save changes' - end - - step 'I should see project with new settings' do - find_field('project_name').value.should == 'NewName' - end - - step 'change project path settings' do - fill_in 'project_path', with: 'new-path' - click_button 'Rename' - end - - step 'I should see project with new path settings' do - project.path.should == 'new-path' - end - - step 'I change the project avatar' do - attach_file( - :project_avatar, - File.join(Rails.root, 'public', 'gitlab_logo.png') - ) - click_button 'Save changes' - @project.reload - end - - step 'I should see new project avatar' do - @project.avatar.should be_instance_of AvatarUploader - url = @project.avatar.url - url.should == "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" - end - - step 'I should see the "Remove avatar" button' do - page.should have_link('Remove avatar') - end - - step 'I have an project avatar' do - attach_file( - :project_avatar, - File.join(Rails.root, 'public', 'gitlab_logo.png') - ) - click_button 'Save changes' - @project.reload - end - - step 'I remove my project avatar' do - click_link 'Remove avatar' - @project.reload - end - - step 'I should see the default project avatar' do - @project.avatar?.should be_false - end - - step 'I should not see the "Remove avatar" button' do - page.should_not have_link('Remove avatar') - end - - step 'I should see project "Shop" version' do - within '.project-side' do - page.should have_content 'Version: 6.7.0.pre' - end - end - - step 'change project default branch' do - select 'fix', from: 'project_default_branch' - click_button 'Save changes' - end - - step 'I should see project default branch changed' do - find(:css, 'select#project_default_branch').value.should == 'fix' - end - - step 'I select project "Forum" README tab' do - click_link 'Readme' - end - - step 'I should see project "Forum" README' do - page.should have_link 'README.md' - page.should have_content 'Sample repo for testing gitlab features' - end - - step 'I should see project "Shop" README' do - page.should have_link 'README.md' - page.should have_content 'testme' - end -end diff --git a/features/steps/project/project_shortcuts.rb b/features/steps/project/project_shortcuts.rb deleted file mode 100644 index a10e7bf78ee..00000000000 --- a/features/steps/project/project_shortcuts.rb +++ /dev/null @@ -1,36 +0,0 @@ -class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedProjectTab - - step 'I press "g" and "f"' do - find('body').native.send_key('g') - find('body').native.send_key('f') - end - - step 'I press "g" and "c"' do - find('body').native.send_key('g') - find('body').native.send_key('c') - end - - step 'I press "g" and "n"' do - find('body').native.send_key('g') - find('body').native.send_key('n') - end - - step 'I press "g" and "g"' do - find('body').native.send_key('g') - find('body').native.send_key('g') - end - - step 'I press "g" and "s"' do - find('body').native.send_key('g') - find('body').native.send_key('s') - end - - step 'I press "g" and "w"' do - find('body').native.send_key('g') - find('body').native.send_key('w') - end -end diff --git a/features/steps/project/redirects.rb b/features/steps/project/redirects.rb deleted file mode 100644 index 57c6e39c801..00000000000 --- a/features/steps/project/redirects.rb +++ /dev/null @@ -1,69 +0,0 @@ -class Spinach::Features::ProjectRedirects < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'public project "Community"' do - create :project, :public, name: 'Community' - end - - step 'private project "Enterprise"' do - create :project, name: 'Enterprise' - end - - step 'I visit project "Community" page' do - project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) - end - - step 'I should see project "Community" home page' do - Gitlab.config.gitlab.should_receive(:host).and_return("www.example.com") - within '.navbar-gitlab .title' do - page.should have_content 'Community' - end - end - - step 'I visit project "Enterprise" page' do - project = Project.find_by(name: 'Enterprise') - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "CommunityDoesNotExist" page' do - project = Project.find_by(name: 'Community') - visit namespace_project_path(project.namespace, project) + 'DoesNotExist' - end - - step 'I click on "Sign In"' do - first(:link, "Sign in").click - end - - step 'Authenticate' do - admin = create(:admin) - project = Project.find_by(name: 'Community') - fill_in "user_login", with: admin.email - fill_in "user_password", with: admin.password - click_button "Sign in" - Thread.current[:current_user] = admin - end - - step 'I should be redirected to "Community" page' do - project = Project.find_by(name: 'Community') - current_path.should == "/#{project.path_with_namespace}" - status_code.should == 200 - end - - step 'I get redirected to signin page where I sign in' do - admin = create(:admin) - project = Project.find_by(name: 'Enterprise') - fill_in "user_login", with: admin.email - fill_in "user_password", with: admin.password - click_button "Sign in" - Thread.current[:current_user] = admin - end - - step 'I should be redirected to "Enterprise" page' do - project = Project.find_by(name: 'Enterprise') - current_path.should == "/#{project.path_with_namespace}" - status_code.should == 200 - end -end diff --git a/features/steps/project/services.rb b/features/steps/project/services.rb deleted file mode 100644 index 4b3d79324ab..00000000000 --- a/features/steps/project/services.rb +++ /dev/null @@ -1,225 +0,0 @@ -class Spinach::Features::ProjectServices < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I visit project "Shop" services page' do - visit namespace_project_services_path(@project.namespace, @project) - end - - step 'I should see list of available services' do - page.should have_content 'Project services' - page.should have_content 'Campfire' - page.should have_content 'HipChat' - page.should have_content 'GitLab CI' - page.should have_content 'Assembla' - page.should have_content 'Pushover' - page.should have_content 'Atlassian Bamboo' - page.should have_content 'JetBrains TeamCity' - page.should have_content 'Asana' - page.should have_content 'Irker (IRC gateway)' - end - - step 'I click gitlab-ci service link' do - click_link 'GitLab CI' - end - - step 'I fill gitlab-ci settings' do - check 'Active' - fill_in 'Project url', with: 'http://ci.gitlab.org/projects/3' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see service settings saved' do - find_field('Project url').value.should == 'http://ci.gitlab.org/projects/3' - end - - step 'I click hipchat service link' do - click_link 'HipChat' - end - - step 'I fill hipchat settings' do - check 'Active' - fill_in 'Room', with: 'gitlab' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see hipchat service settings saved' do - find_field('Room').value.should == 'gitlab' - end - - step 'I fill hipchat settings with custom server' do - check 'Active' - fill_in 'Room', with: 'gitlab_custom' - fill_in 'Token', with: 'secretCustom' - fill_in 'Server', with: 'https://chat.example.com' - click_button 'Save' - end - - step 'I should see hipchat service settings with custom server saved' do - find_field('Server').value.should == 'https://chat.example.com' - end - - step 'I click pivotaltracker service link' do - click_link 'PivotalTracker' - end - - step 'I fill pivotaltracker settings' do - check 'Active' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see pivotaltracker service settings saved' do - find_field('Token').value.should == 'verySecret' - end - - step 'I click Flowdock service link' do - click_link 'Flowdock' - end - - step 'I fill Flowdock settings' do - check 'Active' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see Flowdock service settings saved' do - find_field('Token').value.should == 'verySecret' - end - - step 'I click Assembla service link' do - click_link 'Assembla' - end - - step 'I fill Assembla settings' do - check 'Active' - fill_in 'Token', with: 'verySecret' - click_button 'Save' - end - - step 'I should see Assembla service settings saved' do - find_field('Token').value.should == 'verySecret' - end - - step 'I click Asana service link' do - click_link 'Asana' - end - - step 'I fill Asana settings' do - check 'Active' - fill_in 'Api key', with: 'verySecret' - fill_in 'Restrict to branch', with: 'master' - click_button 'Save' - end - - step 'I should see Asana service settings saved' do - find_field('Api key').value.should == 'verySecret' - find_field('Restrict to branch').value.should == 'master' - end - - step 'I click email on push service link' do - click_link 'Emails on push' - end - - step 'I fill email on push settings' do - fill_in 'Recipients', with: 'qa@company.name' - click_button 'Save' - end - - step 'I should see email on push service settings saved' do - find_field('Recipients').value.should == 'qa@company.name' - end - - step 'I click Irker service link' do - click_link 'Irker (IRC gateway)' - end - - step 'I fill Irker settings' do - check 'Active' - fill_in 'Recipients', with: 'irc://chat.freenode.net/#commits' - check 'Colorize messages' - click_button 'Save' - end - - step 'I should see Irker service settings saved' do - find_field('Recipients').value.should == 'irc://chat.freenode.net/#commits' - find_field('Colorize messages').value.should == '1' - end - - step 'I click Slack service link' do - click_link 'Slack' - end - - step 'I fill Slack settings' do - check 'Active' - fill_in 'Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' - click_button 'Save' - end - - step 'I should see Slack service settings saved' do - find_field('Webhook').value.should == 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685' - end - - step 'I click Pushover service link' do - click_link 'Pushover' - end - - step 'I fill Pushover settings' do - check 'Active' - fill_in 'Api key', with: 'verySecret' - fill_in 'User key', with: 'verySecret' - fill_in 'Device', with: 'myDevice' - select 'High Priority', from: 'Priority' - select 'Bike', from: 'Sound' - click_button 'Save' - end - - step 'I should see Pushover service settings saved' do - find_field('Api key').value.should == 'verySecret' - find_field('User key').value.should == 'verySecret' - find_field('Device').value.should == 'myDevice' - find_field('Priority').find('option[selected]').value.should == '1' - find_field('Sound').find('option[selected]').value.should == 'bike' - end - - step 'I click Atlassian Bamboo CI service link' do - click_link 'Atlassian Bamboo CI' - end - - step 'I fill Atlassian Bamboo CI settings' do - check 'Active' - fill_in 'Bamboo url', with: 'http://bamboo.example.com' - fill_in 'Build key', with: 'KEY' - fill_in 'Username', with: 'user' - fill_in 'Password', with: 'verySecret' - click_button 'Save' - end - - step 'I should see Atlassian Bamboo CI service settings saved' do - find_field('Bamboo url').value.should == 'http://bamboo.example.com' - find_field('Build key').value.should == 'KEY' - find_field('Username').value.should == 'user' - end - - step 'I click JetBrains TeamCity CI service link' do - click_link 'JetBrains TeamCity CI' - end - - step 'I fill JetBrains TeamCity CI settings' do - check 'Active' - fill_in 'Teamcity url', with: 'http://teamcity.example.com' - fill_in 'Build type', with: 'GitlabTest_Build' - fill_in 'Username', with: 'user' - fill_in 'Password', with: 'verySecret' - click_button 'Save' - end - - step 'I should see JetBrains TeamCity CI service settings saved' do - find_field('Teamcity url').value.should == 'http://teamcity.example.com' - find_field('Build type').value.should == 'GitlabTest_Build' - find_field('Username').value.should == 'user' - end -end diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb deleted file mode 100644 index 343aeb53b11..00000000000 --- a/features/steps/project/snippets.rb +++ /dev/null @@ -1,95 +0,0 @@ -class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedNote - include SharedPaths - - step 'project "Shop" have "Snippet one" snippet' do - create(:project_snippet, - title: "Snippet one", - content: "Test content", - file_name: "snippet.rb", - project: project, - author: project.users.first) - end - - step 'project "Shop" have no "Snippet two" snippet' do - create(:snippet, - title: "Snippet two", - content: "Test content", - file_name: "snippet.rb", - author: project.users.first) - end - - step 'I click link "New Snippet"' do - click_link "Add new snippet" - end - - step 'I click link "Snippet one"' do - click_link "Snippet one" - end - - step 'I should see "Snippet one" in snippets' do - page.should have_content "Snippet one" - end - - step 'I should not see "Snippet two" in snippets' do - page.should_not have_content "Snippet two" - end - - step 'I should not see "Snippet one" in snippets' do - page.should_not have_content "Snippet one" - end - - step 'I click link "Edit"' do - within ".file-title" do - click_link "Edit" - end - end - - step 'I click link "Remove Snippet"' do - click_link "remove" - end - - step 'I submit new snippet "Snippet three"' do - fill_in "project_snippet_title", :with => "Snippet three" - fill_in "project_snippet_file_name", :with => "my_snippet.rb" - within('.file-editor') do - find(:xpath, "//input[@id='project_snippet_content']").set 'Content of snippet three' - end - click_button "Create snippet" - end - - step 'I should see snippet "Snippet three"' do - page.should have_content "Snippet three" - page.should have_content "Content of snippet three" - end - - step 'I submit new title "Snippet new title"' do - fill_in "project_snippet_title", :with => "Snippet new title" - click_button "Save" - end - - step 'I should see "Snippet new title"' do - page.should have_content "Snippet new title" - end - - step 'I leave a comment like "Good snippet!"' do - within('.js-main-target-form') do - fill_in "note_note", with: "Good snippet!" - click_button "Add Comment" - end - end - - step 'I should see comment "Good snippet!"' do - page.should have_content "Good snippet!" - end - - step 'I visit snippet page "Snippet one"' do - visit namespace_project_snippet_path(project.namespace, project, project_snippet) - end - - def project_snippet - @project_snippet ||= ProjectSnippet.find_by!(title: "Snippet one") - end -end diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb deleted file mode 100644 index caf6c73ee06..00000000000 --- a/features/steps/project/source/browse_files.rb +++ /dev/null @@ -1,218 +0,0 @@ -class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include RepoHelpers - - step 'I should see files from repository' do - page.should have_content "VERSION" - page.should have_content ".gitignore" - page.should have_content "LICENSE" - end - - step 'I should see files from repository for "6d39438"' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "6d39438") - page.should have_content ".gitignore" - page.should have_content "LICENSE" - end - - step 'I see the ".gitignore"' do - page.should have_content '.gitignore' - end - - step 'I don\'t see the ".gitignore"' do - page.should_not have_content '.gitignore' - end - - step 'I click on ".gitignore" file in repo' do - click_link ".gitignore" - end - - step 'I should see its content' do - page.should have_content old_gitignore_content - end - - step 'I should see its new content' do - page.should have_content new_gitignore_content - end - - step 'I click link "Raw"' do - click_link 'Raw' - end - - step 'I should see raw file content' do - source.should == sample_blob.data - end - - step 'I click button "Edit"' do - click_link 'Edit' - end - - step 'I cannot see the edit button' do - page.should_not have_link 'edit' - end - - step 'The edit button is disabled' do - page.should have_css '.disabled', text: 'Edit' - end - - step 'I can edit code' do - set_new_content - evaluate_script('blob.editor.getValue()').should == new_gitignore_content - end - - step 'I edit code' do - set_new_content - end - - step 'I fill the new file name' do - fill_in :file_name, with: new_file_name - end - - step 'I fill the new branch name' do - fill_in :new_branch, with: 'new_branch_name' - 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 commit message' do - fill_in :commit_message, with: 'Not yet a commit message.' - end - - step 'I click link "Diff"' do - click_link 'Preview changes' - end - - step 'I click on "Commit Changes"' do - click_button 'Commit Changes' - end - - step 'I click on "Remove"' do - click_button 'Remove' - end - - step 'I click on "Remove file"' do - click_button 'Remove file' - end - - step 'I see diff' do - page.should have_css '.line_holder.new' - end - - step 'I click on "new file" link in repo' do - click_link 'new-file-link' - end - - step 'I can see new file page' do - page.should have_content "New file" - page.should have_content "Commit message" - end - - step 'I click on files directory' do - click_link 'files' - end - - step 'I click on History link' do - click_link 'History' - end - - step 'I see Browse dir link' do - page.should have_link 'Browse Dir »' - page.should_not have_link 'Browse Code »' - end - - step 'I click on readme file' do - within '.tree-table' do - click_link 'README.md' - end - end - - step 'I see Browse file link' do - page.should have_link 'Browse File »' - page.should_not have_link 'Browse Code »' - end - - step 'I see Browse code link' do - page.should have_link 'Browse Code »' - page.should_not have_link 'Browse File »' - page.should_not have_link 'Browse Dir »' - end - - step 'I click on Permalink' do - click_link 'Permalink' - end - - step 'I am redirected to the files URL' do - current_path.should == namespace_project_tree_path(@project.namespace, @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')) - end - - step 'I am redirected to the ".gitignore" on new branch' do - expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'new_branch_name/.gitignore')) - end - - step 'I am redirected to the permalink URL' do - expect(current_path).to( - eq(namespace_project_blob_path(@project.namespace, @project, - @project.repository.commit.sha + - '/.gitignore')) - ) - end - - 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)) - end - - step 'I am redirected to the new file on new branch' do - expect(current_path).to eq(namespace_project_blob_path( - @project.namespace, @project, 'new_branch_name/' + new_file_name)) - end - - step "I don't see the permalink link" do - expect(page).not_to have_link('permalink') - end - - step 'I see a commit error message' do - expect(page).to have_content('Your changes could not be committed') - end - - step 'I create bare repo' do - click_link 'Create empty bare repository' - end - - step 'I click on "add a file" link' do - click_link 'add a file' - - # Remove pre-receive hook so we can push without auth - FileUtils.rm_f(File.join(@project.repository.path, 'hooks', 'pre-receive')) - end - - private - - def set_new_content - execute_script("blob.editor.setValue('#{new_gitignore_content}')") - end - - # Content of the gitignore file on the seed repository. - def old_gitignore_content - '*.rbc' - end - - # Constant value that differs from the content - # of the gitignore of the seed repository. - def new_gitignore_content - old_gitignore_content + 'a' - end - - # Constant value that is a valid filename and - # not a filename present at root of the seed repository. - def new_file_name - 'not_a_file.md' - end -end diff --git a/features/steps/project/source/git_blame.rb b/features/steps/project/source/git_blame.rb deleted file mode 100644 index e29a816c51b..00000000000 --- a/features/steps/project/source/git_blame.rb +++ /dev/null @@ -1,19 +0,0 @@ -class Spinach::Features::ProjectSourceGitBlame < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click on ".gitignore" file in repo' do - click_link ".gitignore" - end - - step 'I click Blame button' do - click_link 'Blame' - end - - step 'I should see git file blame' do - page.should have_content "*.rb" - page.should have_content "Dmitriy Zaporozhets" - page.should have_content "Initial commit" - end -end diff --git a/features/steps/project/source/markdown_render.rb b/features/steps/project/source/markdown_render.rb deleted file mode 100644 index 7961fdedad8..00000000000 --- a/features/steps/project/source/markdown_render.rb +++ /dev/null @@ -1,288 +0,0 @@ -# If you need to modify the existing seed repository for your tests, -# it is recommended that you make the changes on the `markdown` branch of the seed project repository, -# which should only be used by tests in this file. See `/spec/factories.rb#project` for more info. -class Spinach::Features::ProjectSourceMarkdownRender < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedMarkdown - - step 'I own project "Delta"' do - @project = Project.find_by(name: "Delta") - @project ||= create(:project, name: "Delta", namespace: @user.namespace) - @project.team << [@user, :master] - end - - step 'I should see files from repository in markdown' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") - page.should have_content "README.md" - page.should have_content "CHANGELOG" - end - - step 'I should see rendered README which contains correct links' do - page.should have_content "Welcome to GitLab GitLab is a free project and repository management application" - page.should have_link "GitLab API doc" - page.should have_link "GitLab API website" - page.should have_link "Rake tasks" - page.should have_link "backup and restore procedure" - page.should have_link "GitLab API doc directory" - page.should have_link "Maintenance" - end - - step 'I click on Gitlab API in README' do - click_link "GitLab API doc" - end - - step 'I should see correct document rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "All API requests require authentication" - end - - step 'I click on Rake tasks in README' do - click_link "Rake tasks" - end - - step 'I should see correct directory rendered' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") - page.should have_content "backup_restore.md" - page.should have_content "maintenance.md" - end - - step 'I click on GitLab API doc directory in README' do - click_link "GitLab API doc directory" - end - - step 'I should see correct doc/api directory rendered' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - page.should have_content "README.md" - page.should have_content "users.md" - end - - step 'I click on Maintenance in README' do - click_link "Maintenance" - end - - step 'I should see correct maintenance file rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/raketasks/maintenance.md") - page.should have_content "bundle exec rake gitlab:env:info RAILS_ENV=production" - end - - step 'I click on link "empty" in the README' do - within('.readme-holder') do - click_link "empty" - end - end - - step 'I click on link "id" in the README' do - within('.readme-holder') do - click_link "#id" - end - end - - step 'I navigate to the doc/api/README' do - within '.tree-table' do - click_link "doc" - end - - within '.tree-table' do - click_link "api" - end - - within '.tree-table' do - click_link "README.md" - end - end - - step 'I see correct file rendered' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "Contents" - page.should have_link "Users" - page.should have_link "Rake tasks" - end - - step 'I click on users in doc/api/README' do - click_link "Users" - end - - step 'I should see the correct document file' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "Get a list of users." - end - - step 'I click on raketasks in doc/api/README' do - click_link "Rake tasks" - end - - # Markdown branch - - When 'I visit markdown branch' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown") - end - - When 'I visit markdown branch "README.md" blob' do - visit namespace_project_blob_path(@project.namespace, @project, "markdown/README.md") - end - - When 'I visit markdown branch "d" tree' do - visit namespace_project_tree_path(@project.namespace, @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") - end - - step 'I should see files from repository in markdown branch' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown") - page.should have_content "README.md" - page.should have_content "CHANGELOG" - end - - step 'I see correct file rendered in markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "Contents" - page.should have_link "Users" - page.should have_link "Rake tasks" - end - - step 'I should see correct document rendered for markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/README.md") - page.should have_content "All API requests require authentication" - end - - step 'I should see correct directory rendered for markdown branch' do - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/raketasks") - page.should have_content "backup_restore.md" - page.should have_content "maintenance.md" - end - - step 'I should see the users document file in markdown branch' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "Get a list of users." - end - - # Expected link contents - - step 'The link with text "empty" should have url "tree/markdown"' do - find('a', text: /^empty$/)['href'] == current_host + namespace_project_tree_path(@project.namespace, @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") - 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") - 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") - 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' - 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' - 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' - 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' - 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' - 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' - end - - # Wiki - - step 'I go to wiki page' do - click_link "Wiki" - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - end - - step 'I add various links to the wiki page' do - fill_in "wiki[content]", with: "[test](test)\n[GitLab API doc](api)\n[Rake tasks](raketasks)\n" - fill_in "wiki[message]", with: "Adding links to wiki" - click_button "Create page" - end - - step 'Wiki page should have added links' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - page.should have_content "test GitLab API doc Rake tasks" - end - - step 'I add a header to the wiki page' do - fill_in "wiki[content]", with: "# Wiki header\n" - fill_in "wiki[message]", with: "Add header to wiki" - click_button "Create page" - end - - step 'Wiki header should have correct id and link' do - header_should_have_correct_id_and_link(1, 'Wiki header', 'wiki-header') - end - - step 'I click on test link' do - click_link "test" - end - - step 'I see new wiki page named test' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "test") - page.should have_content "Editing" - end - - When 'I go back to wiki page home' do - visit namespace_project_wiki_path(@project.namespace, @project, "home") - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "home") - end - - step 'I click on GitLab API doc link' do - click_link "GitLab API" - end - - step 'I see Gitlab API document' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "api") - page.should have_content "Editing" - end - - step 'I click on Rake tasks link' do - click_link "Rake tasks" - end - - step 'I see Rake tasks directory' do - current_path.should == namespace_project_wiki_path(@project.namespace, @project, "raketasks") - page.should have_content "Editing" - end - - step 'I go directory which contains README file' do - visit namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - current_path.should == namespace_project_tree_path(@project.namespace, @project, "markdown/doc/api") - end - - step 'I click on a relative link in README' do - click_link "Users" - end - - step 'I should see the correct markdown' do - current_path.should == namespace_project_blob_path(@project.namespace, @project, "markdown/doc/api/users.md") - page.should have_content "List users" - end - - step 'Header "Application details" should have correct id and link' do - header_should_have_correct_id_and_link(2, 'Application details', 'application-details') - end - - step 'Header "GitLab API" should have correct id and link' do - header_should_have_correct_id_and_link(1, 'GitLab API', 'gitlab-api') - end -end diff --git a/features/steps/project/source/multiselect_blob.rb b/features/steps/project/source/multiselect_blob.rb deleted file mode 100644 index b749ba49371..00000000000 --- a/features/steps/project/source/multiselect_blob.rb +++ /dev/null @@ -1,58 +0,0 @@ -class Spinach::Features::ProjectSourceMultiselectBlob < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - class << self - def click_line_steps(*line_numbers) - line_numbers.each do |line_number| - step "I click line #{line_number} in file" do - find("#L#{line_number}").click - end - - step "I shift-click line #{line_number} in file" do - script = "$('#L#{line_number}').trigger($.Event('click', { shiftKey: true }));" - execute_script(script) - end - end - end - - def check_state_steps(*ranges) - ranges.each do |range| - fragment = range.kind_of?(Array) ? "L#{range.first}-#{range.last}" : "L#{range}" - pluralization = range.kind_of?(Array) ? "s" : "" - - step "I should see \"#{fragment}\" as URI fragment" do - URI.parse(current_url).fragment.should == fragment - end - - step "I should see line#{pluralization} #{fragment[1..-1]} highlighted" do - ids = Array(range).map { |n| "LC#{n}" } - extra = false - - highlighted = all("#tree-content-holder .highlight .line.hll") - highlighted.each do |element| - extra ||= ids.delete(element[:id]).nil? - end - - extra.should be_false and ids.should be_empty - end - end - end - end - - click_line_steps *Array(1..5) - check_state_steps *Array(1..5), Array(1..2), Array(1..3), Array(1..4), Array(1..5), Array(3..5) - - step 'I go back in history' do - go_back - end - - step 'I go forward in history' do - go_forward - end - - step 'I click on ".gitignore" file in repo' do - click_link ".gitignore" - end -end diff --git a/features/steps/project/source/search_code.rb b/features/steps/project/source/search_code.rb deleted file mode 100644 index 9c2864cc936..00000000000 --- a/features/steps/project/source/search_code.rb +++ /dev/null @@ -1,19 +0,0 @@ -class Spinach::Features::ProjectSourceSearchCode < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I search for term "coffee"' do - fill_in "search", with: "coffee" - click_button "Go" - end - - step 'I should see files from repository containing "coffee"' do - page.should have_content 'coffee' - page.should have_content 'CONTRIBUTING.md' - end - - step 'I should see empty result' do - page.should have_content "We couldn't find any matching" - end -end diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb deleted file mode 100644 index 50cdfd73c34..00000000000 --- a/features/steps/project/star.rb +++ /dev/null @@ -1,37 +0,0 @@ -class Spinach::Features::ProjectStar < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include SharedUser - - step "The project has no stars" do - page.should_not have_content '.star-buttons' - end - - step "The project has 0 stars" do - has_n_stars(0) - end - - step "The project has 1 star" do - has_n_stars(1) - end - - step "The project has 2 stars" do - has_n_stars(2) - end - - # Requires @javascript - step "I click on the star toggle button" do - find(".star-btn", visible: true).click - end - - step 'I redirected to sign in page' do - current_path.should == new_user_session_path - end - - protected - - def has_n_stars(n) - expect(page).to have_css(".star-btn .count", text: n, visible: true) - end -end diff --git a/features/steps/project/team_management.rb b/features/steps/project/team_management.rb deleted file mode 100644 index e95621071c4..00000000000 --- a/features/steps/project/team_management.rb +++ /dev/null @@ -1,130 +0,0 @@ -class Spinach::Features::ProjectTeamManagement < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - include Select2Helper - - step 'I should be able to see myself in team' do - page.should have_content(@user.name) - page.should have_content(@user.username) - end - - step 'I should see "Sam" in team list' do - user = User.find_by(name: "Sam") - page.should have_content(user.name) - page.should have_content(user.username) - end - - step 'I click link "Add members"' do - find(:css, 'button.btn-new').click - end - - step 'I select "Mike" as "Reporter"' do - user = User.find_by(name: "Mike") - - within ".users-project-form" do - select2(user.id, from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add users to project" - end - - step 'I should see "Mike" in team list as "Reporter"' do - within ".access-reporter" do - page.should have_content('Mike') - end - end - - step 'I select "sjobs@apple.com" as "Reporter"' do - within ".users-project-form" do - select2("sjobs@apple.com", from: "#user_ids", multiple: true) - select "Reporter", from: "access_level" - end - click_button "Add users to project" - end - - step 'I should see "sjobs@apple.com" in team list as invited "Reporter"' do - within ".access-reporter" do - page.should have_content('sjobs@apple.com') - page.should have_content('invited') - page.should have_content('Reporter') - end - end - - step 'I should see "Sam" in team list as "Developer"' do - within ".access-developer" do - page.should have_content('Sam') - end - end - - step 'I change "Sam" role to "Reporter"' do - project = Project.find_by(name: "Shop") - user = User.find_by(name: 'Sam') - project_member = project.project_members.find_by(user_id: user.id) - within "#project_member_#{project_member.id}" do - click_button "Edit access level" - select "Reporter", from: "project_member_access_level" - click_button "Save" - end - end - - step 'I should see "Sam" in team list as "Reporter"' do - within ".access-reporter" do - page.should have_content('Sam') - end - end - - step 'I click link "Remove from team"' do - click_link "Remove from team" - end - - step 'I should not see "Sam" in team list' do - user = User.find_by(name: "Sam") - page.should_not have_content(user.name) - page.should_not have_content(user.username) - end - - step 'gitlab user "Mike"' do - create(:user, name: "Mike") - end - - step 'gitlab user "Sam"' do - create(:user, name: "Sam") - end - - step '"Sam" is "Shop" developer' do - user = User.find_by(name: "Sam") - project = Project.find_by(name: "Shop") - project.team << [user, :developer] - end - - step 'I own project "Website"' do - @project = create(:empty_project, name: "Website", namespace: @user.namespace) - @project.team << [@user, :master] - end - - step '"Mike" is "Website" reporter' do - user = User.find_by(name: "Mike") - project = Project.find_by(name: "Website") - project.team << [user, :reporter] - end - - step 'I click link "Import team from another project"' do - click_link "Import members from another project" - end - - When 'I submit "Website" project for import team' do - project = Project.find_by(name: "Website") - select project.name_with_namespace, from: 'source_project_id' - click_button 'Import' - end - - step 'I click cancel link for "Sam"' do - project = Project.find_by(name: "Shop") - user = User.find_by(name: 'Sam') - project_member = project.project_members.find_by(user_id: user.id) - within "#project_member_#{project_member.id}" do - click_link('Remove user from team') - end - end -end diff --git a/features/steps/project/wiki.rb b/features/steps/project/wiki.rb deleted file mode 100644 index bb93e582a1f..00000000000 --- a/features/steps/project/wiki.rb +++ /dev/null @@ -1,165 +0,0 @@ -class Spinach::Features::ProjectWiki < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedNote - include SharedPaths - include WikiHelper - - step 'I click on the Cancel button' do - within(:css, ".form-actions") do - click_on "Cancel" - end - end - - step 'I should be redirected back to the Edit Home Wiki page' do - current_path.should == namespace_project_wiki_path(project.namespace, project, :home) - end - - step 'I create the Wiki Home page' do - fill_in "wiki_content", with: '[link test](test)' - click_on "Create page" - end - - step 'I should see the newly created wiki page' do - page.should have_content "Home" - page.should have_content "link test" - - click_link "link test" - page.should have_content "Editing" - end - - step 'I have an existing Wiki page' do - wiki.create_page("existing", "content", :markdown, "first commit") - @page = wiki.find_page("existing") - end - - step 'I browse to that Wiki page' do - visit namespace_project_wiki_path(project.namespace, project, @page) - end - - step 'I click on the Edit button' do - click_on "Edit" - end - - step 'I change the content' do - fill_in "Content", with: 'Updated Wiki Content' - click_on "Save changes" - end - - step 'I should see the updated content' do - page.should have_content "Updated Wiki Content" - end - - step 'I should be redirected back to that Wiki page' do - current_path.should == namespace_project_wiki_path(project.namespace, project, @page) - end - - step 'That page has two revisions' do - @page.update("new content", :markdown, "second commit") - end - - step 'I click the History button' do - click_on "History" - end - - step 'I should see both revisions' do - page.should have_content current_user.name - page.should have_content "first commit" - page.should have_content "second commit" - end - - step 'I click on the "Delete this page" button' do - click_on "Delete this page" - end - - step 'The page should be deleted' do - page.should have_content "Page was successfully deleted" - end - - step 'I click on the "Pages" button' do - click_on "Pages" - end - - step 'I should see the existing page in the pages list' do - page.should have_content current_user.name - page.should have_content @page.title - end - - step 'I have an existing Wiki page with images linked on page' do - wiki.create_page("pictures", "Look at this [image](image.jpg)\n\n ![image](image.jpg)", :markdown, "first commit") - @wiki_page = wiki.find_page("pictures") - end - - step 'I browse to wiki page with images' do - visit namespace_project_wiki_path(project.namespace, project, @wiki_page) - end - - step 'I click on existing image link' do - file = Gollum::File.new(wiki.wiki) - Gollum::Wiki.any_instance.stub(:file).with("image.jpg", "master", true).and_return(file) - Gollum::File.any_instance.stub(:mime_type).and_return("image/jpeg") - page.should have_link('image', href: "image.jpg") - click_on "image" - end - - step 'I should see the image from wiki repo' do - current_path.should match('wikis/image.jpg') - page.should_not have_xpath('/html') # Page should render the image which means there is no html involved - Gollum::Wiki.any_instance.unstub(:file) - Gollum::File.any_instance.unstub(:mime_type) - end - - step 'Image should be shown on the page' do - page.should have_xpath("//img[@src=\"image.jpg\"]") - end - - step 'I click on image link' do - page.should have_link('image', href: "image.jpg") - click_on "image" - end - - step 'I should see the new wiki page form' do - current_path.should match('wikis/image.jpg') - page.should have_content('New Wiki Page') - page.should have_content('Editing - image.jpg') - end - - step 'I create a New page with paths' do - click_on 'New Page' - fill_in 'Page slug', with: 'one/two/three' - click_on 'Build' - fill_in "wiki_content", with: 'wiki content' - click_on "Create page" - current_path.should include 'one/two/three' - end - - step 'I should see non-escaped link in the pages list' do - page.should have_xpath("//a[@href='/#{project.path_with_namespace}/wikis/one/two/three']") - end - - step 'I edit the Wiki page with a path' do - click_on 'three' - click_on 'Edit' - end - - step 'I should see a non-escaped path' do - current_path.should include 'one/two/three' - end - - step 'I should see the Editing page' do - page.should have_content('Editing') - end - - step 'I view the page history of a Wiki page that has a path' do - click_on 'three' - click_on 'Page History' - end - - step 'I should see the page history' do - page.should have_content('History for') - end - - def wiki - @project_wiki = ProjectWiki.new(project, current_user) - end -end diff --git a/features/steps/search.rb b/features/steps/search.rb deleted file mode 100644 index 6f0e038c4d6..00000000000 --- a/features/steps/search.rb +++ /dev/null @@ -1,69 +0,0 @@ -class Spinach::Features::Search < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - - step 'I search for "Sho"' do - fill_in "dashboard_search", with: "Sho" - click_button "Search" - end - - step 'I search for "Foo"' do - fill_in "dashboard_search", with: "Foo" - click_button "Search" - end - - step 'I search for "rspec"' do - fill_in "dashboard_search", with: "rspec" - click_button "Search" - end - - step 'I click "Issues" link' do - within '.search-filter' do - click_link 'Issues' - end - end - - step 'I click project "Shop" link' do - within '.project-filter' do - click_link project.name_with_namespace - end - end - - step 'I click "Merge requests" link' do - within '.search-filter' do - click_link 'Merge requests' - end - end - - step 'I should see "Shop" project link' do - page.should have_link "Shop" - end - - step 'I should see code results for project "Shop"' do - page.should have_content 'Update capybara, rspec-rails, poltergeist to recent versions' - end - - step 'I search for "Contibuting"' do - fill_in "dashboard_search", with: "Contibuting" - click_button "Search" - end - - step 'project has issues' do - create(:issue, title: "Foo", project: project) - create(:issue, title: "Bar", project: project) - end - - step 'project has merge requests' do - create(:merge_request, title: "Foo", source_project: project, target_project: project) - create(:merge_request, :simple, title: "Bar", source_project: project, target_project: project) - end - - step 'I should see "Foo" link in the search results' do - find(:css, '.search-results').should have_link 'Foo' - end - - step 'I should not see "Bar" link in the search results' do - find(:css, '.search-results').should_not have_link 'Bar' - end -end diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb deleted file mode 100644 index 9beb688bd16..00000000000 --- a/features/steps/shared/active_tab.rb +++ /dev/null @@ -1,47 +0,0 @@ -module SharedActiveTab - include Spinach::DSL - - def ensure_active_main_tab(content) - find('.nav-sidebar > li.active').should have_content(content) - end - - def ensure_active_sub_tab(content) - find('div.content ul.nav-tabs li.active').should have_content(content) - end - - def ensure_active_sub_nav(content) - find('.sidebar-subnav > li.active').should have_content(content) - end - - step 'no other main tabs should be active' do - page.should have_selector('.nav-sidebar > li.active', count: 1) - end - - step 'no other sub tabs should be active' do - page.should have_selector('div.content ul.nav-tabs li.active', count: 1) - end - - step 'no other sub navs should be active' do - page.should have_selector('.sidebar-subnav > li.active', count: 1) - end - - step 'the active main tab should be Home' do - ensure_active_main_tab('Your Projects') - end - - step 'the active main tab should be Projects' do - ensure_active_main_tab('Projects') - end - - step 'the active main tab should be Issues' do - ensure_active_main_tab('Issues') - end - - step 'the active main tab should be Merge Requests' do - ensure_active_main_tab('Merge Requests') - end - - step 'the active main tab should be Help' do - ensure_active_main_tab('Help') - end -end diff --git a/features/steps/shared/admin.rb b/features/steps/shared/admin.rb deleted file mode 100644 index b6072995677..00000000000 --- a/features/steps/shared/admin.rb +++ /dev/null @@ -1,12 +0,0 @@ -module SharedAdmin - include Spinach::DSL - - step 'there are projects in system' do - 2.times { create(:project) } - end - - step 'system has users' do - 2.times { create(:user) } - end -end - diff --git a/features/steps/shared/authentication.rb b/features/steps/shared/authentication.rb deleted file mode 100644 index ac8a3df6bb9..00000000000 --- a/features/steps/shared/authentication.rb +++ /dev/null @@ -1,34 +0,0 @@ -require Rails.root.join('spec', 'support', 'login_helpers') - -module SharedAuthentication - include Spinach::DSL - include LoginHelpers - - step 'I sign in as a user' do - login_as :user - end - - step 'I sign in as an admin' do - login_as :admin - end - - step 'I sign in as "John Doe"' do - login_with(user_exists("John Doe")) - end - - step 'I sign in as "Mary Jane"' do - login_with(user_exists("Mary Jane")) - end - - step 'I should be redirected to sign in page' do - current_path.should == new_user_session_path - end - - step "I logout" do - logout - end - - def current_user - @user || User.first - end -end diff --git a/features/steps/shared/diff_note.rb b/features/steps/shared/diff_note.rb deleted file mode 100644 index 510e0f0f938..00000000000 --- a/features/steps/shared/diff_note.rb +++ /dev/null @@ -1,167 +0,0 @@ -module SharedDiffNote - include Spinach::DSL - include RepoHelpers - - step 'I cancel the diff comment' do - within(diff_file_selector) do - find(".js-close-discussion-note-form").click - end - end - - step 'I delete a diff comment' do - find('.note').hover - find(".js-note-delete").click - end - - step 'I haven\'t written any diff comment text' do - within(diff_file_selector) do - fill_in "note[note]", with: "" - end - end - - step 'I leave a diff comment like "Typo, please fix"' do - click_diff_line(sample_commit.line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do - fill_in "note[note]", with: "Typo, please fix" - find(".js-comment-button").trigger("click") - sleep 0.05 - end - end - - step 'I preview a diff comment text like "Should fix it :smile:"' do - click_diff_line(sample_commit.line_code) - within("#{diff_file_selector} form[rel$='#{sample_commit.line_code}']") do - fill_in "note[note]", with: "Should fix it :smile:" - find('.js-md-preview-button').click - end - end - - step 'I preview another diff comment text like "DRY this up"' do - click_diff_line(sample_commit.del_line_code) - - within("#{diff_file_selector} form[rel$='#{sample_commit.del_line_code}']") do - fill_in "note[note]", with: "DRY this up" - find('.js-md-preview-button').click - end - end - - step 'I open a diff comment form' do - click_diff_line(sample_commit.line_code) - end - - step 'I open another diff comment form' do - click_diff_line(sample_commit.del_line_code) - end - - step 'I write a diff comment like ":-1: I don\'t like this"' do - within(diff_file_selector) do - fill_in "note[note]", with: ":-1: I don\'t like this" - end - end - - step 'I submit the diff comment' do - within(diff_file_selector) do - click_button("Add Comment") - end - end - - step 'I should not see the diff comment form' do - within(diff_file_selector) do - page.should_not have_css("form.new_note") - end - end - - step 'The diff comment preview tab should say there is nothing to do' do - within(diff_file_selector) do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_content('Nothing to preview.') - end - end - - step 'I should not see the diff comment text field' do - within(diff_file_selector) do - expect(find('.js-note-text')).not_to be_visible - end - end - - step 'I should only see one diff form' do - within(diff_file_selector) do - page.should have_css("form.new_note", count: 1) - end - end - - step 'I should see a diff comment form with ":-1: I don\'t like this"' do - within(diff_file_selector) do - page.should have_field("note[note]", with: ":-1: I don\'t like this") - end - end - - step 'I should see a diff comment saying "Typo, please fix"' do - within("#{diff_file_selector} .note") do - page.should have_content("Typo, please fix") - end - end - - step 'I should see a discussion reply button' do - within(diff_file_selector) do - page.should have_button('Reply') - end - end - - step 'I should see a temporary diff comment form' do - within(diff_file_selector) do - page.should have_css(".js-temp-notes-holder form.new_note") - end - end - - step 'I should see add a diff comment button' do - page.should have_css('.js-add-diff-note-button', visible: true) - end - - step 'I should see an empty diff comment form' do - within(diff_file_selector) do - page.should have_field("note[note]", with: "") - end - end - - step 'I should see the cancel comment button' do - within("#{diff_file_selector} form") do - page.should have_css(".js-close-discussion-note-form", text: "Cancel") - end - end - - step 'I should see the diff comment preview' do - within("#{diff_file_selector} form") do - expect(page).to have_css('.js-md-preview', visible: true) - end - end - - step 'I should see the diff comment write tab' do - within(diff_file_selector) do - expect(page).to have_css('.js-md-write-button', visible: true) - end - end - - step 'The diff comment preview tab should display rendered Markdown' do - within(diff_file_selector) do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) - end - end - - step 'I should see two separate previews' do - within(diff_file_selector) do - expect(page).to have_css('.js-md-preview', visible: true, count: 2) - expect(page).to have_content('Should fix it') - expect(page).to have_content('DRY this up') - end - end - - def diff_file_selector - ".diff-file:nth-of-type(1)" - end - - def click_diff_line(code) - find("button[data-line-code='#{code}']").click - end -end diff --git a/features/steps/shared/group.rb b/features/steps/shared/group.rb deleted file mode 100644 index 1b225dd61a6..00000000000 --- a/features/steps/shared/group.rb +++ /dev/null @@ -1,44 +0,0 @@ -module SharedGroup - include Spinach::DSL - - step '"John Doe" is owner of group "Owned"' do - is_member_of("John Doe", "Owned", Gitlab::Access::OWNER) - end - - step '"John Doe" is guest of group "Guest"' do - is_member_of("John Doe", "Guest", Gitlab::Access::GUEST) - end - - step '"Mary Jane" is owner of group "Owned"' do - is_member_of("Mary Jane", "Owned", Gitlab::Access::OWNER) - end - - step '"Mary Jane" is guest of group "Owned"' do - is_member_of("Mary Jane", "Owned", Gitlab::Access::GUEST) - end - - step '"Mary Jane" is guest of group "Guest"' do - is_member_of("Mary Jane", "Guest", Gitlab::Access::GUEST) - end - - step 'I should see group "TestGroup"' do - page.should have_content "TestGroup" - end - - step 'I should not see group "TestGroup"' do - page.should_not have_content "TestGroup" - end - - protected - - def is_member_of(username, groupname, role) - @project_count ||= 0 - user = User.find_by(name: username) || create(:user, name: username) - group = Group.find_by(name: groupname) || create(:group, name: groupname) - group.add_user(user, role) - project ||= create(:project, namespace: group, path: "project#{@project_count}") - event ||= create(:closed_issue_event, project: project) - project.team << [user, :master] - @project_count += 1 - end -end diff --git a/features/steps/shared/issuable.rb b/features/steps/shared/issuable.rb deleted file mode 100644 index 41db2612f26..00000000000 --- a/features/steps/shared/issuable.rb +++ /dev/null @@ -1,15 +0,0 @@ -module SharedIssuable - include Spinach::DSL - - def edit_issuable - find(:css, '.issuable-edit').click - end - - step 'I click link "Edit" for the merge request' do - edit_issuable - end - - step 'I click link "Edit" for the issue' do - edit_issuable - end -end diff --git a/features/steps/shared/markdown.rb b/features/steps/shared/markdown.rb deleted file mode 100644 index e71700880cd..00000000000 --- a/features/steps/shared/markdown.rb +++ /dev/null @@ -1,102 +0,0 @@ -module SharedMarkdown - include Spinach::DSL - - def header_should_have_correct_id_and_link(level, text, id, parent = ".wiki") - find(:css, "#{parent} h#{level}##{id}").text.should == text - find(:css, "#{parent} h#{level}##{id} > :last-child")[:href].should =~ /##{id}$/ - end - - def create_taskable(type, title) - desc_text = <<EOT.gsub(/^ {6}/, '') - * [ ] Task 1 - * [x] Task 2 -EOT - - case type - when :issue, :closed_issue - options = { project: project } - when :merge_request - options = { source_project: project, target_project: project } - end - - create( - type, - options.merge(title: title, - author: project.users.first, - description: desc_text) - ) - end - - step 'Header "Description header" should have correct id and link' do - header_should_have_correct_id_and_link(1, 'Description header', 'description-header') - end - - step 'I should see task checkboxes in the description' do - expect(page).to have_selector( - 'div.description li.task-list-item input[type="checkbox"]' - ) - end - - step 'I should see the task status for the Taskable' do - expect(find(:css, 'span.task-status').text).to eq( - '2 tasks (1 done, 1 unfinished)' - ) - end - - step 'Task checkboxes should be enabled' do - expect(page).to have_selector( - 'div.description li.task-list-item input[type="checkbox"]:enabled' - ) - end - - step 'Task checkboxes should be disabled' do - expect(page).to have_selector( - 'div.description li.task-list-item input[type="checkbox"]:disabled' - ) - end - - step 'I should not see the Markdown preview' do - expect(find('.gfm-form .js-md-preview')).not_to be_visible - end - - step 'The Markdown preview tab should say there is nothing to do' do - within('.gfm-form') do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_content('Nothing to preview.') - end - end - - step 'I should not see the Markdown text field' do - expect(find('.gfm-form textarea')).not_to be_visible - end - - step 'I should see the Markdown write tab' do - expect(find('.gfm-form')).to have_css('.js-md-write-button', visible: true) - end - - step 'I should see the Markdown preview' do - expect(find('.gfm-form')).to have_css('.js-md-preview', visible: true) - end - - step 'The Markdown preview tab should display rendered Markdown' do - within('.gfm-form') do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) - end - end - - step 'I write a description like ":+1: Nice"' do - find('.gfm-form').fill_in 'Description', with: ':+1: Nice' - end - - step 'I preview a description text like "Bug fixed :smile:"' do - within('.gfm-form') do - fill_in 'Description', with: 'Bug fixed :smile:' - find('.js-md-preview-button').click - end - end - - step 'I haven\'t written any description text' do - find('.gfm-form').fill_in 'Description', with: '' - end -end diff --git a/features/steps/shared/note.rb b/features/steps/shared/note.rb deleted file mode 100644 index 583746d4475..00000000000 --- a/features/steps/shared/note.rb +++ /dev/null @@ -1,155 +0,0 @@ -module SharedNote - include Spinach::DSL - - step 'I delete a comment' do - find('.note').hover - find(".js-note-delete").click - end - - step 'I haven\'t written any comment text' do - within(".js-main-target-form") do - fill_in "note[note]", with: "" - end - end - - step 'I leave a comment like "XML attached"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "XML attached" - click_button "Add Comment" - sleep 0.05 - end - end - - step 'I preview a comment text like "Bug fixed :smile:"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "Bug fixed :smile:" - find('.js-md-preview-button').click - end - end - - step 'I submit the comment' do - within(".js-main-target-form") do - click_button "Add Comment" - end - end - - step 'I write a comment like ":+1: Nice"' do - within(".js-main-target-form") do - fill_in 'note[note]', with: ':+1: Nice' - end - end - - step 'I should not see a comment saying "XML attached"' do - page.should_not have_css(".note") - end - - step 'I should not see the cancel comment button' do - within(".js-main-target-form") do - should_not have_link("Cancel") - end - end - - step 'I should not see the comment preview' do - within(".js-main-target-form") do - expect(find('.js-md-preview')).not_to be_visible - end - end - - step 'The comment preview tab should say there is nothing to do' do - within(".js-main-target-form") do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_content('Nothing to preview.') - end - end - - step 'I should not see the comment text field' do - within(".js-main-target-form") do - expect(find('.js-note-text')).not_to be_visible - end - end - - step 'I should see a comment saying "XML attached"' do - within(".note") do - page.should have_content("XML attached") - end - end - - step 'I should see an empty comment text field' do - within(".js-main-target-form") do - page.should have_field("note[note]", with: "") - end - end - - step 'I should see the comment write tab' do - within(".js-main-target-form") do - expect(page).to have_css('.js-md-write-button', visible: true) - end - end - - step 'The comment preview tab should be display rendered Markdown' do - within(".js-main-target-form") do - find('.js-md-preview-button').click - expect(find('.js-md-preview')).to have_css('img.emoji', visible: true) - end - end - - step 'I should see the comment preview' do - within(".js-main-target-form") do - expect(page).to have_css('.js-md-preview', visible: true) - end - end - - step 'I should see comment "XML attached"' do - within(".note") do - page.should have_content("XML attached") - end - end - - # Markdown - - step 'I leave a comment with a header containing "Comment with a header"' do - within(".js-main-target-form") do - fill_in "note[note]", with: "# Comment with a header" - click_button "Add Comment" - sleep 0.05 - end - end - - step 'The comment with the header should not have an ID' do - within(".note-body > .note-text") do - page.should have_content("Comment with a header") - page.should_not have_css("#comment-with-a-header") - end - end - - step 'I leave a comment with task markdown' do - within('.js-main-target-form') do - fill_in 'note[note]', with: '* [x] Task item' - click_button 'Add Comment' - sleep 0.05 - end - end - - step 'I should not see task checkboxes in the comment' do - expect(page).not_to have_selector( - 'li.note div.timeline-content input[type="checkbox"]' - ) - end - - step 'I edit the last comment with a +1' do - find(".note").hover - find('.js-note-edit').click - - within(".current-note-edit-form") do - fill_in 'note[note]', with: '+1 Awesome!' - click_button 'Save Comment' - sleep 0.05 - end - end - - step 'I should see +1 in the description' do - within(".note") do - page.should have_content("+1 Awesome!") - end - end -end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb deleted file mode 100644 index e3cf1b92cda..00000000000 --- a/features/steps/shared/paths.rb +++ /dev/null @@ -1,480 +0,0 @@ -module SharedPaths - include Spinach::DSL - include RepoHelpers - include DashboardHelper - - step 'I visit new project page' do - visit new_project_path - end - - # ---------------------------------------- - # User - # ---------------------------------------- - - step 'I visit user "John Doe" page' do - visit user_path("john_doe") - end - - # ---------------------------------------- - # Group - # ---------------------------------------- - - step 'I visit group "Owned" page' do - visit group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" issues page' do - visit issues_group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" merge requests page' do - visit merge_requests_group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" members page' do - visit group_group_members_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Owned" settings page' do - visit edit_group_path(Group.find_by(name:"Owned")) - end - - step 'I visit group "Guest" page' do - visit group_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" issues page' do - visit issues_group_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" merge requests page' do - visit merge_requests_group_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" members page' do - visit group_group_members_path(Group.find_by(name:"Guest")) - end - - step 'I visit group "Guest" settings page' do - visit edit_group_path(Group.find_by(name:"Guest")) - end - - # ---------------------------------------- - # Dashboard - # ---------------------------------------- - - step 'I visit dashboard page' do - visit dashboard_path - end - - step 'I visit dashboard projects page' do - visit projects_dashboard_path - end - - step 'I visit dashboard issues page' do - visit assigned_issues_dashboard_path - end - - step 'I visit dashboard merge requests page' do - visit assigned_mrs_dashboard_path - end - - step 'I visit dashboard search page' do - visit search_path - end - - step 'I visit dashboard help page' do - visit help_path - end - - step 'I visit dashboard groups page' do - visit dashboard_groups_path - end - - step 'I should be redirected to the dashboard groups page' do - current_path.should == dashboard_groups_path - end - - step 'I visit dashboard starred projects page' do - visit starred_dashboard_projects_path - end - - # ---------------------------------------- - # Profile - # ---------------------------------------- - - step 'I visit profile page' do - visit profile_path - end - - step 'I visit profile applications page' do - visit applications_profile_path - end - - step 'I visit profile password page' do - visit edit_profile_password_path - end - - step 'I visit profile account page' do - visit profile_account_path - end - - step 'I visit profile SSH keys page' do - visit profile_keys_path - end - - step 'I visit profile design page' do - visit design_profile_path - end - - step 'I visit profile history page' do - visit history_profile_path - end - - # ---------------------------------------- - # Admin - # ---------------------------------------- - - step 'I visit admin page' do - visit admin_root_path - end - - step 'I visit admin projects page' do - visit admin_namespaces_projects_path - end - - step 'I visit admin users page' do - visit admin_users_path - end - - step 'I visit admin logs page' do - visit admin_logs_path - end - - step 'I visit admin messages page' do - visit admin_broadcast_messages_path - end - - step 'I visit admin hooks page' do - visit admin_hooks_path - end - - step 'I visit admin Resque page' do - visit admin_background_jobs_path - end - - step 'I visit admin groups page' do - visit admin_groups_path - end - - step 'I visit admin teams page' do - visit admin_teams_path - end - - step 'I visit admin settings page' do - visit admin_application_settings_path - end - - step 'I visit applications page' do - visit admin_applications_path - end - - # ---------------------------------------- - # Generic Project - # ---------------------------------------- - - step "I visit my project's home page" do - visit namespace_project_path(@project.namespace, @project) - end - - step "I visit my project's settings page" do - visit edit_namespace_project_path(@project.namespace, @project) - end - - step "I visit my project's files page" do - visit namespace_project_tree_path(@project.namespace, @project, root_ref) - end - - step 'I visit a binary file in the repo' do - visit namespace_project_blob_path(@project.namespace, @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}) - 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}) - end - - step 'I visit my project\'s commits stats page' do - visit stats_namespace_project_repository_path(@project.namespace, @project) - end - - step "I visit my project's network 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) - end - - step "I visit my project's issues page" do - visit namespace_project_issues_path(@project.namespace, @project) - end - - step "I visit my project's merge requests page" do - visit namespace_project_merge_requests_path(@project.namespace, @project) - end - - step "I visit my project's wiki page" do - visit namespace_project_wiki_path(@project.namespace, @project, :home) - end - - step 'I visit project hooks page' do - visit namespace_project_hooks_path(@project.namespace, @project) - end - - step 'I visit project deploy keys page' do - visit namespace_project_deploy_keys_path(@project.namespace, @project) - end - - # ---------------------------------------- - # "Shop" Project - # ---------------------------------------- - - step 'I visit project "Shop" page' do - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "Forked Shop" merge requests page' do - visit namespace_project_merge_requests_path(@forked_project.namespace, @forked_project) - end - - step 'I visit edit project "Shop" page' do - visit edit_namespace_project_path(project.namespace, project) - end - - step 'I visit project branches page' do - visit namespace_project_branches_path(@project.namespace, @project) - end - - step 'I visit project protected branches page' do - visit namespace_project_protected_branches_path(@project.namespace, @project) - end - - step 'I visit compare refs page' do - visit namespace_project_compare_index_path(@project.namespace, @project) - end - - step 'I visit project commits page' do - visit namespace_project_commits_path(@project.namespace, @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}) - end - - step 'I visit project source page' do - visit namespace_project_tree_path(@project.namespace, @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)) - end - - step 'I visit ".gitignore" file in repo' do - visit namespace_project_blob_path(@project.namespace, @project, File.join(root_ref, '.gitignore')) - end - - step 'I am on the new file page' do - current_path.should eq(namespace_project_create_blob_path(@project.namespace, @project, root_ref)) - end - - step 'I am on the ".gitignore" edit file page' do - current_path.should eq(namespace_project_edit_blob_path( - @project.namespace, @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") - end - - step 'I visit project source page for' \ - ' "6d394385cf567f80a8fd85055db1ab4c5295806f"' do - visit namespace_project_tree_path(@project.namespace, @project, - '6d394385cf567f80a8fd85055db1ab4c5295806f') - end - - step 'I visit project tags page' do - visit namespace_project_tags_path(@project.namespace, @project) - end - - step 'I visit project commit page' do - visit namespace_project_commit_path(@project.namespace, @project, sample_commit.id) - end - - step 'I visit project "Shop" issues page' do - visit namespace_project_issues_path(project.namespace, 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) - end - - step 'I visit issue page "Tasks-open"' do - issue = Issue.find_by(title: 'Tasks-open') - visit namespace_project_issue_path(issue.project.namespace, issue.project, issue) - end - - step 'I visit issue page "Tasks-closed"' do - issue = Issue.find_by(title: 'Tasks-closed') - visit namespace_project_issue_path(issue.project.namespace, 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) - end - - step 'I visit project "Forum" labels page' do - project = Project.find_by(name: 'Forum') - visit namespace_project_labels_path(project.namespace, 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) - 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) - end - - step 'I visit merge request page "Bug NS-04"' do - mr = MergeRequest.find_by(title: "Bug NS-04") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit merge request page "Bug NS-05"' do - mr = MergeRequest.find_by(title: "Bug NS-05") - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit merge request page "MR-task-open"' do - mr = MergeRequest.find_by(title: 'MR-task-open') - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit merge request page "MR-task-closed"' do - mr = MergeRequest.find_by(title: 'MR-task-closed') - visit namespace_project_merge_request_path(mr.target_project.namespace, mr.target_project, mr) - end - - step 'I visit project "Shop" merge requests page' do - visit namespace_project_merge_requests_path(project.namespace, project) - end - - step 'I visit forked project "Shop" merge requests page' do - visit namespace_project_merge_requests_path(project.namespace, project) - end - - step 'I visit project "Shop" milestones page' do - visit namespace_project_milestones_path(project.namespace, project) - end - - step 'I visit project "Shop" team page' do - visit namespace_project_project_members_path(project.namespace, project) - end - - step 'I visit project wiki page' do - visit namespace_project_wiki_path(@project.namespace, @project, :home) - end - - # ---------------------------------------- - # Visibility Projects - # ---------------------------------------- - - step 'I visit project "Community" page' do - project = Project.find_by(name: "Community") - visit namespace_project_path(project.namespace, 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) - end - - step 'I visit project "Internal" page' do - project = Project.find_by(name: "Internal") - visit namespace_project_path(project.namespace, project) - end - - step 'I visit project "Enterprise" page' do - project = Project.find_by(name: "Enterprise") - visit namespace_project_path(project.namespace, project) - end - - # ---------------------------------------- - # Empty Projects - # ---------------------------------------- - - step "I visit empty project page" do - project = Project.find_by(name: "Empty Public Project") - visit namespace_project_path(project.namespace, project) - end - - # ---------------------------------------- - # Public Projects - # ---------------------------------------- - - step 'I visit the public projects area' do - visit explore_projects_path - end - - step 'I visit the explore trending projects' do - visit trending_explore_projects_path - end - - step 'I visit the explore starred projects' do - visit starred_explore_projects_path - end - - step 'I visit the public groups area' do - visit explore_groups_path - end - - # ---------------------------------------- - # Snippets - # ---------------------------------------- - - step 'I visit project "Shop" snippets page' do - visit namespace_project_snippets_path(project.namespace, project) - end - - step 'I visit snippets page' do - visit snippets_path - end - - step 'I visit new snippet page' do - visit new_snippet_path - end - - def root_ref - @project.repository.root_ref - end - - def project - Project.find_by!(name: 'Shop') - end - - # ---------------------------------------- - # Errors - # ---------------------------------------- - - step 'page status code should be 404' do - status_code.should == 404 - end -end diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb deleted file mode 100644 index b60ac5e3423..00000000000 --- a/features/steps/shared/project.rb +++ /dev/null @@ -1,160 +0,0 @@ -module SharedProject - include Spinach::DSL - - # Create a project without caring about what it's called - step "I own a project" do - @project = create(:project, namespace: @user.namespace) - @project.team << [@user, :master] - end - - # Create a specific project called "Shop" - step 'I own project "Shop"' do - @project = Project.find_by(name: "Shop") - @project ||= create(:project, name: "Shop", namespace: @user.namespace, snippets_enabled: true) - @project.team << [@user, :master] - end - - # Add another user to project "Shop" - step 'I add a user to project "Shop"' do - @project = Project.find_by(name: "Shop") - other_user = create(:user, name: 'Alpha') - @project.team << [other_user, :master] - end - - # Create another specific project called "Forum" - step 'I own project "Forum"' do - @project = Project.find_by(name: "Forum") - @project ||= create(:project, name: "Forum", namespace: @user.namespace, path: 'forum_project') - @project.team << [@user, :master] - end - - # Create an empty project without caring about the name - step 'I own an empty project' do - @project = create(:empty_project, - name: 'Empty Project', namespace: @user.namespace) - @project.team << [@user, :master] - end - - step 'I visit my empty project page' do - project = Project.find_by(name: 'Empty Project') - visit namespace_project_path(project.namespace, project) - end - - step 'project "Shop" has push event' do - @project = Project.find_by(name: "Shop") - - data = { - before: Gitlab::Git::BLANK_SHA, - after: "6d394385cf567f80a8fd85055db1ab4c5295806f", - ref: "refs/heads/fix", - 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 'I should see project "Shop" activity feed' do - project = Project.find_by(name: "Shop") - page.should have_content "#{@user.name} pushed new branch fix at #{project.name_with_namespace}" - end - - step 'I should see project settings' do - current_path.should == edit_namespace_project_path(@project.namespace, @project) - page.should have_content("Project name") - page.should have_content("Features:") - end - - def current_project - @project ||= Project.first - end - - # ---------------------------------------- - # Visibility level - # ---------------------------------------- - - step 'private project "Enterprise"' do - create :project, name: 'Enterprise' - end - - step 'I should see project "Enterprise"' do - page.should have_content "Enterprise" - end - - step 'I should not see project "Enterprise"' do - page.should_not have_content "Enterprise" - end - - step 'internal project "Internal"' do - create :project, :internal, name: 'Internal' - end - - step 'I should see project "Internal"' do - page.should have_content "Internal" - end - - step 'I should not see project "Internal"' do - page.should_not have_content "Internal" - end - - step 'public project "Community"' do - create :project, :public, name: 'Community' - end - - step 'I should see project "Community"' do - page.should have_content "Community" - end - - step 'I should not see project "Community"' do - page.should_not have_content "Community" - end - - step '"John Doe" owns private project "Enterprise"' do - user = user_exists("John Doe", username: "john_doe") - project = Project.find_by(name: "Enterprise") - project ||= create(:empty_project, name: "Enterprise", namespace: user.namespace) - project.team << [user, :master] - end - - step '"John Doe" owns internal project "Internal"' do - user = user_exists("John Doe", username: "john_doe") - project = Project.find_by(name: "Internal") - project ||= create :empty_project, :internal, name: 'Internal', namespace: user.namespace - project.team << [user, :master] - end - - step '"John Doe" owns public project "Community"' do - user = user_exists("John Doe", username: "john_doe") - project = Project.find_by(name: "Community") - project ||= create :empty_project, :public, name: 'Community', namespace: user.namespace - project.team << [user, :master] - end - - step 'public empty project "Empty Public Project"' do - create :project_empty_repo, :public, name: "Empty Public Project" - end - - step 'project "Community" has comments' do - project = Project.find_by(name: "Community") - 2.times { create(:note_on_issue, project: project) } - end - - step 'project "Shop" has labels: "bug", "feature", "enhancement"' do - project = Project.find_by(name: "Shop") - create(:label, project: project, title: 'bug') - create(:label, project: project, title: 'feature') - create(:label, project: project, title: 'enhancement') - end -end diff --git a/features/steps/shared/project_tab.rb b/features/steps/shared/project_tab.rb deleted file mode 100644 index c5aed19331c..00000000000 --- a/features/steps/shared/project_tab.rb +++ /dev/null @@ -1,48 +0,0 @@ -require_relative 'active_tab' - -module SharedProjectTab - include Spinach::DSL - include SharedActiveTab - - step 'the active main tab should be Home' do - ensure_active_main_tab('Project') - end - - step 'the active main tab should be Files' do - ensure_active_main_tab('Files') - end - - step 'the active main tab should be Commits' do - ensure_active_main_tab('Commits') - end - - step 'the active main tab should be Network' do - ensure_active_main_tab('Network') - end - - step 'the active main tab should be Graphs' do - ensure_active_main_tab('Graphs') - end - - step 'the active main tab should be Issues' do - ensure_active_main_tab('Issues') - end - - step 'the active main tab should be Merge Requests' do - ensure_active_main_tab('Merge Requests') - end - - step 'the active main tab should be Snippets' do - ensure_active_main_tab('Snippets') - end - - step 'the active main tab should be Wiki' do - ensure_active_main_tab('Wiki') - end - - step 'the active main tab should be Settings' do - within '.nav-sidebar' do - page.should have_content('Back to project') - end - end -end diff --git a/features/steps/shared/search.rb b/features/steps/shared/search.rb deleted file mode 100644 index 6c3d601763d..00000000000 --- a/features/steps/shared/search.rb +++ /dev/null @@ -1,11 +0,0 @@ -module SharedSearch - include Spinach::DSL - - def search_snippet_contents(query) - visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_blobs" - end - - def search_snippet_titles(query) - visit "/search?search=#{URI::encode(query)}&snippets=true&scope=snippet_titles" - end -end diff --git a/features/steps/shared/shortcuts.rb b/features/steps/shared/shortcuts.rb deleted file mode 100644 index bbb7afec0ad..00000000000 --- a/features/steps/shared/shortcuts.rb +++ /dev/null @@ -1,18 +0,0 @@ -module SharedActiveTab - include Spinach::DSL - - step 'I press "g" and "p"' do - find('body').native.send_key('g') - find('body').native.send_key('p') - end - - step 'I press "g" and "i"' do - find('body').native.send_key('g') - find('body').native.send_key('i') - end - - step 'I press "g" and "m"' do - find('body').native.send_key('g') - find('body').native.send_key('m') - end -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/shared/user.rb b/features/steps/shared/user.rb deleted file mode 100644 index 209d77c7acf..00000000000 --- a/features/steps/shared/user.rb +++ /dev/null @@ -1,17 +0,0 @@ -module SharedUser - include Spinach::DSL - - step 'User "John Doe" exists' do - user_exists("John Doe", {username: "john_doe"}) - end - - step 'User "Mary Jane" exists' do - user_exists("Mary Jane", {username: "mary_jane"}) - end - - protected - - def user_exists(name, options = {}) - User.find_by(name: name) || create(:user, {name: name, admin: false}.merge(options)) - end -end diff --git a/features/steps/snippet_search.rb b/features/steps/snippet_search.rb deleted file mode 100644 index 669c7186c1b..00000000000 --- a/features/steps/snippet_search.rb +++ /dev/null @@ -1,56 +0,0 @@ -class Spinach::Features::SnippetSearch < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - include SharedUser - include SharedSearch - - step 'I search for "snippet" in snippet titles' do - search_snippet_titles 'snippet' - end - - step 'I search for "snippet private" in snippet titles' do - search_snippet_titles 'snippet private' - end - - step 'I search for "line seven" in snippet contents' do - search_snippet_contents 'line seven' - end - - step 'I should see "line seven" in results' do - page.should have_content 'line seven' - end - - step 'I should see "line four" in results' do - page.should have_content 'line four' - end - - step 'I should see "line ten" in results' do - page.should have_content 'line ten' - end - - step 'I should not see "line eleven" in results' do - page.should_not have_content 'line eleven' - end - - step 'I should not see "line three" in results' do - page.should_not have_content 'line three' - end - - step 'I should see "Personal snippet one" in results' do - page.should have_content 'Personal snippet one' - end - - step 'I should see "Personal snippet private" in results' do - page.should have_content 'Personal snippet private' - end - - step 'I should not see "Personal snippet one" in results' do - page.should_not have_content 'Personal snippet one' - end - - step 'I should not see "Personal snippet private" in results' do - page.should_not have_content 'Personal snippet private' - end - -end diff --git a/features/steps/snippets/discover.rb b/features/steps/snippets/discover.rb deleted file mode 100644 index 2667c1e3d44..00000000000 --- a/features/steps/snippets/discover.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Spinach::Features::SnippetsDiscover < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I should see "Personal snippet one" in snippets' do - page.should have_content "Personal snippet one" - end - - step 'I should see "Personal snippet internal" in snippets' do - page.should have_content "Personal snippet internal" - end - - step 'I should not see "Personal snippet private" in snippets' do - page.should_not have_content "Personal snippet private" - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/snippets/public_snippets.rb b/features/steps/snippets/public_snippets.rb deleted file mode 100644 index 67669dc0a69..00000000000 --- a/features/steps/snippets/public_snippets.rb +++ /dev/null @@ -1,25 +0,0 @@ -class Spinach::Features::PublicSnippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I should see snippet "Personal snippet one"' do - page.should have_no_xpath("//i[@class='public-snippet']") - end - - step 'I should see raw snippet "Personal snippet one"' do - page.should have_text(snippet.content) - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - step 'I visit snippet raw page "Personal snippet one"' do - visit raw_snippet_path(snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/snippets/snippets.rb b/features/steps/snippets/snippets.rb deleted file mode 100644 index de936db85ee..00000000000 --- a/features/steps/snippets/snippets.rb +++ /dev/null @@ -1,64 +0,0 @@ -class Spinach::Features::Snippets < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedProject - include SharedSnippet - - 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 - page.should_not have_content "Personal snippet one" - end - - step 'I click link "Edit"' do - within ".file-title" do - click_link "Edit" - end - end - - step 'I click link "Destroy"' do - click_link "remove" - 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" - within('.file-editor') do - find(:xpath, "//input[@id='personal_snippet_content']").set 'Content of snippet three' - end - click_button "Create snippet" - end - - step 'I should see snippet "Personal snippet three"' do - page.should have_content "Personal snippet three" - page.should 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 - page.should 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 - page.should have_no_xpath("//i[@class='public-snippet']") - end - - step 'I visit snippet page "Personal snippet one"' do - visit snippet_path(snippet) - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/snippets/user.rb b/features/steps/snippets/user.rb deleted file mode 100644 index 866f637ab6c..00000000000 --- a/features/steps/snippets/user.rb +++ /dev/null @@ -1,55 +0,0 @@ -class Spinach::Features::SnippetsUser < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedSnippet - - step 'I visit my snippets page' do - visit user_snippets_path(current_user) - end - - step 'I should see "Personal snippet one" in snippets' do - page.should have_content "Personal snippet one" - end - - step 'I should see "Personal snippet private" in snippets' do - page.should have_content "Personal snippet private" - end - - step 'I should see "Personal snippet internal" in snippets' do - page.should have_content "Personal snippet internal" - end - - step 'I should not see "Personal snippet one" in snippets' do - page.should_not have_content "Personal snippet one" - end - - step 'I should not see "Personal snippet private" in snippets' do - page.should_not have_content "Personal snippet private" - end - - step 'I should not see "Personal snippet internal" in snippets' do - page.should_not have_content "Personal snippet internal" - end - - step 'I click "Internal" filter' do - within('.nav-stacked') do - click_link "Internal" - end - end - - step 'I click "Private" filter' do - within('.nav-stacked') do - click_link "Private" - end - end - - step 'I click "Public" filter' do - within('.nav-stacked') do - click_link "Public" - end - end - - def snippet - @snippet ||= PersonalSnippet.find_by!(title: "Personal snippet one") - end -end diff --git a/features/steps/user.rb b/features/steps/user.rb deleted file mode 100644 index 10cae692a88..00000000000 --- a/features/steps/user.rb +++ /dev/null @@ -1,43 +0,0 @@ -class Spinach::Features::User < Spinach::FeatureSteps - include SharedAuthentication - include SharedPaths - include SharedUser - include SharedProject - - step 'I should see user "John Doe" page' do - expect(title).to match(/^\s*John Doe/) - end - - step '"John Doe" has contributions' do - user = User.find_by(name: 'John Doe') - project = contributed_project - - # Issue controbution - issue_params = { title: 'Bug in old browser' } - Issues::CreateService.new(project, user, issue_params).execute - - # Push code contribution - push_params = { - project: project, - action: Event::PUSHED, - author_id: user.id, - data: { commit_count: 3 } - } - - Event.create(push_params) - end - - step 'I should see contributed projects' do - within '.contributed-projects' do - page.should have_content(@contributed_project.name) - end - end - - step 'I should see contributions calendar' do - page.should have_css('.cal-heatmap-container') - end - - def contributed_project - @contributed_project ||= create(:project, :public) - end -end diff --git a/features/support/env.rb b/features/support/env.rb deleted file mode 100644 index be17065ccfd..00000000000 --- a/features/support/env.rb +++ /dev/null @@ -1,54 +0,0 @@ -if ENV['SIMPLECOV'] - require 'simplecov' -end - -if ENV['COVERALLS'] - require 'coveralls' - Coveralls.wear_merged! -end - -ENV['RAILS_ENV'] = 'test' -require './config/environment' -require 'rspec' -require 'rspec/expectations' -require 'database_cleaner' -require 'spinach/capybara' -require 'sidekiq/testing/inline' - -%w(select2_helper test_env repo_helpers).each do |f| - require Rails.root.join('spec', 'support', f) -end - -Dir["#{Rails.root}/features/steps/shared/*.rb"].each {|file| require file} - -WebMock.allow_net_connect! -# -# JS driver -# -require 'capybara/poltergeist' -Capybara.javascript_driver = :poltergeist -Capybara.register_driver :poltergeist do |app| - Capybara::Poltergeist::Driver.new(app, js_errors: false, timeout: 90) -end -Spinach.hooks.on_tag("javascript") do - ::Capybara.current_driver = ::Capybara.javascript_driver -end -Capybara.default_wait_time = 60 -Capybara.ignore_hidden_elements = false - -DatabaseCleaner.strategy = :truncation - -Spinach.hooks.before_scenario do - DatabaseCleaner.start -end - -Spinach.hooks.after_scenario do - DatabaseCleaner.clean -end - -Spinach.hooks.before_run do - include RSpec::Mocks::ExampleMethods - TestEnv.init(mailer: false) - - include FactoryGirl::Syntax::Methods -end diff --git a/features/user.feature b/features/user.feature deleted file mode 100644 index 69618e929c4..00000000000 --- a/features/user.feature +++ /dev/null @@ -1,78 +0,0 @@ -Feature: User - Background: - Given User "John Doe" exists - And "John Doe" owns private project "Enterprise" - - # Signed out - - Scenario: I visit user "John Doe" page while not signed in when he owns a public project - Given "John Doe" owns internal project "Internal" - And "John Doe" owns public project "Community" - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should not see project "Internal" - And I should see project "Community" - - Scenario: I visit user "John Doe" page while not signed in when he is not authorized to a public project - Given "John Doe" owns internal project "Internal" - When I visit user "John Doe" page - Then I should be redirected to sign in page - - # Signed in as someone else - - Scenario: I visit user "John Doe" page while signed in as someone else when he owns a public project - Given "John Doe" owns public project "Community" - And "John Doe" owns internal project "Internal" - And I sign in as a user - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should see project "Internal" - And I should see project "Community" - - Scenario: I visit user "John Doe" page while signed in as someone else when he is not authorized to a public project - Given "John Doe" owns internal project "Internal" - And I sign in as a user - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should see project "Internal" - And I should not see project "Community" - - Scenario: I visit user "John Doe" page while signed in as someone else when he is not authorized to a project I can see - Given I sign in as a user - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should not see project "Enterprise" - And I should not see project "Internal" - And I should not see project "Community" - - # Signed in as the user himself - - Scenario: I visit user "John Doe" page while signed in as "John Doe" when he has a public project - Given "John Doe" owns internal project "Internal" - And "John Doe" owns public project "Community" - And I sign in as "John Doe" - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should see project "Enterprise" - And I should see project "Internal" - And I should see project "Community" - - Scenario: I visit user "John Doe" page while signed in as "John Doe" when he has no public project - Given I sign in as "John Doe" - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should see project "Enterprise" - And I should not see project "Internal" - And I should not see project "Community" - - @javascript - Scenario: "John Doe" contribution profile - Given I sign in as a user - And "John Doe" has contributions - When I visit user "John Doe" page - Then I should see user "John Doe" page - And I should see contributed projects - And I should see contributions calendar |