From 569c7becf0ef18f56d03d738b8fedadbec869c08 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Wed, 30 Aug 2017 08:54:43 +1100 Subject: Replace 'project/star.feature' spinach test with an rspec analog --- features/project/star.feature | 39 --------------------------------------- features/steps/project/star.rb | 37 ------------------------------------- 2 files changed, 76 deletions(-) delete mode 100644 features/project/star.feature delete mode 100644 features/steps/project/star.rb (limited to 'features') diff --git a/features/project/star.feature b/features/project/star.feature deleted file mode 100644 index 618f44fe6dc..00000000000 --- a/features/project/star.feature +++ /dev/null @@ -1,39 +0,0 @@ -@project-stars -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/steps/project/star.rb b/features/steps/project/star.rb deleted file mode 100644 index 9f7c748a3b7..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 - expect(page).not_to have_content '.toggle-star' - 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 - expect(current_path).to eq new_user_session_path - end - - protected - - def has_n_stars(n) - expect(page).to have_css(".star-count", text: n, visible: true) - end -end -- cgit v1.2.1 From 96e0020c70ba69de873067b092626295d8388bf0 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Wed, 30 Aug 2017 09:31:26 +1100 Subject: Replace 'project/user_lookup.feature' spinach test with an rspec analog --- features/project/commits/user_lookup.feature | 16 --------- features/steps/project/commits/user_lookup.rb | 49 --------------------------- 2 files changed, 65 deletions(-) delete mode 100644 features/project/commits/user_lookup.feature delete mode 100644 features/steps/project/commits/user_lookup.rb (limited to 'features') diff --git a/features/project/commits/user_lookup.feature b/features/project/commits/user_lookup.feature deleted file mode 100644 index c18f4e070f3..00000000000 --- a/features/project/commits/user_lookup.feature +++ /dev/null @@ -1,16 +0,0 @@ -@project_commits -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/steps/project/commits/user_lookup.rb b/features/steps/project/commits/user_lookup.rb deleted file mode 100644 index 4599e0d032a..00000000000 --- a/features/steps/project/commits/user_lookup.rb +++ /dev/null @@ -1,49 +0,0 @@ -class Spinach::Features::ProjectCommitsUserLookup < Spinach::FeatureSteps - include SharedAuthentication - include SharedProject - include SharedPaths - - step 'I click on commit link' do - visit project_commit_path(@project, sample_commit.id) - end - - step 'I click on another commit link' do - visit project_commit_path(@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') - - expect(author_link['href']).to eq user_path(user) - expect(author_link['title']).to eq email - expect(find('.commit-author-name').text).to eq 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 -- cgit v1.2.1