From 021fcebc2840e5ff1ad95d5eae7506440084be75 Mon Sep 17 00:00:00 2001 From: Semyon Pupkov Date: Sat, 20 Jan 2018 14:37:36 +0500 Subject: Move user page spinach tests to RSpec https://gitlab.com/gitlab-org/gitlab-ce/issues/23036 --- features/steps/user.rb | 38 ---------------------- features/user.feature | 86 -------------------------------------------------- 2 files changed, 124 deletions(-) delete mode 100644 features/steps/user.rb delete mode 100644 features/user.feature (limited to 'features') diff --git a/features/steps/user.rb b/features/steps/user.rb deleted file mode 100644 index 321c1e942d5..00000000000 --- a/features/steps/user.rb +++ /dev/null @@ -1,38 +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 contribution - issue_params = { title: 'Bug in old browser' } - Issues::CreateService.new(project, user, issue_params).execute - - # Push code contribution - event = create(:push_event, project: project, author: user) - - create(:push_event_payload, event: event, commit_count: 3) - end - - step 'I should see contributed projects' do - page.within '#contributed' do - expect(page).to have_content(@contributed_project.name) - end - end - - step 'I should see contributions calendar' do - expect(page).to have_css('.js-contrib-calendar') - end - - def contributed_project - @contributed_project ||= create(:project, :public, :empty_repo) - end -end diff --git a/features/user.feature b/features/user.feature deleted file mode 100644 index e0cadba30a1..00000000000 --- a/features/user.feature +++ /dev/null @@ -1,86 +0,0 @@ -Feature: User - Background: - Given User "John Doe" exists - And "John Doe" owns private project "Enterprise" - - # Signed out - - @javascript - 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 - And I click on "Personal projects" tab - 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" - - # Signed in as someone else - - @javascript - 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 - And I click on "Personal projects" tab - 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" - - @javascript - 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 - And I click on "Personal projects" tab - 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" - - @javascript - 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 - And I click on "Personal projects" tab - 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 - - @javascript - 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 - And I click on "Personal projects" tab - 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" - - @javascript - 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 - And I click on "Personal projects" tab - 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 - And I click on "Contributed projects" tab - Then I should see user "John Doe" page - And I should see contributed projects - And I should see contributions calendar -- cgit v1.2.1