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/project/labels.feature | 13 ++++++------- features/steps/project/labels.rb | 8 ++++---- 2 files changed, 10 insertions(+), 11 deletions(-) (limited to 'features') diff --git a/features/project/labels.feature b/features/project/labels.feature index cd3f3a789f0..955bc3d8b1b 100644 --- a/features/project/labels.feature +++ b/features/project/labels.feature @@ -3,14 +3,13 @@ Feature: Labels Background: Given I sign in as a user And I own project "Shop" - And I visit project "Shop" issues page And project "Shop" has labels: "bug", "feature", "enhancement" + When I visit project "Shop" labels page @javascript Scenario: I can subscribe to a label - When I visit project "Shop" labels page - Then I should see that I am unsubscribed - When I click button "Subscribe" - Then I should see that I am subscribed - When I click button "Unsubscribe" - Then I should see that I am unsubscribed + Then I should see that I am not subscribed to the "bug" label + When I click button "Subscribe" for the "bug" label + Then I should see that I am subscribed to the "bug" label + When I click button "Unsubscribe" for the "bug" label + Then I should see that I am not subscribed to the "bug" label 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.3