From e632bd26e4b70b100e5c9891b4b2cc7e267080c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 1 Mar 2016 12:32:20 +0100 Subject: Fixes "iid of max iid" in Issuable sidebar for merged MR Fixes #13928 --- features/steps/project/merge_requests.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'features/steps/project') diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb index c19b15bc9ed..2eb98e91dbf 100644 --- a/features/steps/project/merge_requests.rb +++ b/features/steps/project/merge_requests.rb @@ -16,10 +16,18 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps click_link "Bug NS-04" end + step 'I click link "Feature NS-05"' do + click_link "Feature NS-05" + end + step 'I click link "All"' do click_link "All" end + step 'I click link "Merged"' do + click_link "Merged" + end + step 'I click link "Closed"' do click_link "Closed" end @@ -40,6 +48,10 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps expect(page).to have_content "Bug NS-04" end + step 'I should see merge request "Feature NS-05"' do + expect(page).to have_content "Feature NS-05" + end + step 'I should not see "master" branch' do expect(find('.merge-request-info')).not_to have_content "master" end @@ -120,6 +132,14 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps author: project.users.first) end + step 'project "Shop" have "Feature NS-05" merged merge request' do + create(:merged_merge_request, + title: "Feature NS-05", + source_project: project, + target_project: project, + author: project.users.first) + end + step 'project "Shop" have "Bug NS-07" open merge request with rebased branch' do create(:merge_request, :rebased, title: "Bug NS-07", -- cgit v1.2.1 From a181722ae4dc0b1bb564d34b30e30f823cc72bc0 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sun, 13 Mar 2016 13:39:28 -0700 Subject: Improve award emoji test reliability and eliminate sleeps Closes #14129 --- features/steps/project/issues/award_emoji.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'features/steps/project') diff --git a/features/steps/project/issues/award_emoji.rb b/features/steps/project/issues/award_emoji.rb index 135e1d016ae..ce2554bc80d 100644 --- a/features/steps/project/issues/award_emoji.rb +++ b/features/steps/project/issues/award_emoji.rb @@ -13,7 +13,6 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps thumbsup = page.first('.award-control') thumbsup.click thumbsup.hover - sleep 0.3 end end @@ -46,12 +45,10 @@ class Spinach::Features::AwardEmoji < Spinach::FeatureSteps end step 'I have award added' do - sleep 0.2 - page.within '.awards' do expect(page).to have_selector '.js-emoji-btn' expect(page.find('.js-emoji-btn.active .js-counter')).to have_content '1' - expect(page.find('.js-emoji-btn.active')['data-original-title']).to eq('me') + expect(page).to have_css(".js-emoji-btn.active[data-original-title='me']") end end -- cgit v1.2.1 From 0444fa560acd07255960284f19b1de6499cd5910 Mon Sep 17 00:00:00 2001 From: Timothy Andrew Date: Fri, 12 Feb 2016 20:28:39 +0530 Subject: Original implementation to allow users to subscribe to labels 1. Allow subscribing (the current user) to a label - Refactor the `Subscription` coffeescript class - The main change is that it accepts a container, and conducts all DOM queries within its scope. We need this because the labels page has multiple instances of `Subscription` on the same page. 2. Creating an issue or MR with labels notifies users subscribed to those labels - Label `has_many` subscribers through subscriptions. 3. Adding a label to an issue or MR notifies users subscribed to those labels - This only applies to subscribers of the label that has just been added, not all labels for the issue. --- features/steps/project/labels.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 features/steps/project/labels.rb (limited to 'features/steps/project') diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb new file mode 100644 index 00000000000..3f800a10594 --- /dev/null +++ b/features/steps/project/labels.rb @@ -0,0 +1,34 @@ +class Spinach::Features::Labels < Spinach::FeatureSteps + include SharedAuthentication + include SharedIssuable + include SharedProject + include SharedNote + include SharedPaths + include SharedMarkdown + + step 'And I visit project "Shop" labels page' do + visit namespace_project_labels_path(project.namespace, project) + end + + step 'I should see that I am subscribed' do + expect(subscribe_button).to have_content 'Unsubscribe' + end + + step 'I should see that I am unsubscribed' do + expect(subscribe_button).to have_content 'Subscribe' + end + + step 'I click button "Unsubscribe"' do + subscribe_button.click + end + + step 'I click button "Subscribe"' do + subscribe_button.click + end + + private + + def subscribe_button + first('.subscribe-button span') + end +end -- cgit v1.2.1 From 54ec7e959900493b6e9174bf4dfe09ed0afd1e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 1 Mar 2016 17:33:13 +0100 Subject: Improving the original label-subscribing implementation 1. Make the "subscribed" text in Issuable sidebar reflect the labels subscription status 2. Current user mut be logged-in to toggle issue/MR/label subscription --- features/steps/project/labels.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'features/steps/project') diff --git a/features/steps/project/labels.rb b/features/steps/project/labels.rb index 3f800a10594..17944527e3a 100644 --- a/features/steps/project/labels.rb +++ b/features/steps/project/labels.rb @@ -10,19 +10,19 @@ class Spinach::Features::Labels < Spinach::FeatureSteps visit namespace_project_labels_path(project.namespace, project) end - step 'I should see that I am subscribed' do + step 'I should see that I am subscribed to the "bug" label' do expect(subscribe_button).to have_content 'Unsubscribe' end - step 'I should see that I am unsubscribed' do + step 'I should see that I am not subscribed to the "bug" label' do expect(subscribe_button).to have_content 'Subscribe' end - step 'I click button "Unsubscribe"' do + step 'I click button "Unsubscribe" for the "bug" label' do subscribe_button.click end - step 'I click button "Subscribe"' do + step 'I click button "Subscribe" for the "bug" label' do subscribe_button.click end -- cgit v1.2.1