summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-29 18:50:45 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-03-29 18:50:45 -0700
commit9d6ffcfa5f09608d81031c7e366470b9c8a46db8 (patch)
tree03f25e79adbfcdd405c82eb9a269ee1578c41a6b /features
parent405f91d2b8eb7c8276341ac44fcabc758fc89343 (diff)
downloadgitlab-ce-9d6ffcfa5f09608d81031c7e366470b9c8a46db8.tar.gz
Refactor star btn logic for non-logged in user and fix tests
Diffstat (limited to 'features')
-rw-r--r--features/project/star.feature2
-rw-r--r--features/steps/project/star.rb8
2 files changed, 7 insertions, 3 deletions
diff --git a/features/project/star.feature b/features/project/star.feature
index 3322f891805..a45f9c470ea 100644
--- a/features/project/star.feature
+++ b/features/project/star.feature
@@ -13,7 +13,7 @@ Feature: Project Star
Given public project "Community"
And I visit project "Community" page
When I click on the star toggle button
- Then The project has 0 stars
+ Then I redirected to sign in page
@javascript
Scenario: Signed in users can toggle star
diff --git a/features/steps/project/star.rb b/features/steps/project/star.rb
index ae2e4c7a201..50cdfd73c34 100644
--- a/features/steps/project/star.rb
+++ b/features/steps/project/star.rb
@@ -22,12 +22,16 @@ class Spinach::Features::ProjectStar < Spinach::FeatureSteps
# Requires @javascript
step "I click on the star toggle button" do
- find(".star .toggle", visible: true).click
+ 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 .count", text: /^#{n}$/, visible: true)
+ expect(page).to have_css(".star-btn .count", text: n, visible: true)
end
end