summaryrefslogtreecommitdiff
path: root/spec/controllers/projects_controller_spec.rb
diff options
context:
space:
mode:
authorCiro Santilli <ciro.santilli@gmail.com>2014-07-14 15:17:59 +0200
committerCiro Santilli <ciro.santilli@gmail.com>2014-07-17 22:47:16 +0200
commit9b5c7a4d6026265cfeaeac9ad5101f8826515dbe (patch)
tree18d795d222563b9c672aff1121b11022a32016b7 /spec/controllers/projects_controller_spec.rb
parentecd771ccdfe54b08ea7f80f64667228b7938238d (diff)
downloadgitlab-ce-9b5c7a4d6026265cfeaeac9ad5101f8826515dbe.tar.gz
Add star count, view logic, more tests.
Diffstat (limited to 'spec/controllers/projects_controller_spec.rb')
-rw-r--r--spec/controllers/projects_controller_spec.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb
index c7a48898c56..71bc49787cc 100644
--- a/spec/controllers/projects_controller_spec.rb
+++ b/spec/controllers/projects_controller_spec.rb
@@ -43,15 +43,20 @@ describe ProjectsController do
end
describe "POST #toggle_star" do
- it "increases star count if user is signed in" do
+ it "toggles star if user is signed in" do
sign_in(user)
+ expect(user.starred?(public_project)).to be_false
post :toggle_star, id: public_project.to_param
- expect(public_project.star_count).to eq(1)
+ expect(user.starred?(public_project)).to be_true
+ post :toggle_star, id: public_project.to_param
+ expect(user.starred?(public_project)).to be_false
end
it "does nothing if user is not signed in" do
post :toggle_star, id: public_project.to_param
- expect(public_project.star_count).to eq(0)
+ expect(user.starred?(public_project)).to be_false
+ post :toggle_star, id: public_project.to_param
+ expect(user.starred?(public_project)).to be_false
end
end
end