diff options
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index a36b57a95de..b6ffb6ac24b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -355,4 +355,17 @@ describe User do expect(user.short_website_url).to eq 'test.com' end end + + describe "#toggle_star" do + it "toggles stars" do + user = create :user + project = create :project, :public + + expect(user.starred?(project)).to be_false + user.toggle_star(project) + expect(user.starred?(project)).to be_true + user.toggle_star(project) + expect(user.starred?(project)).to be_false + end + end end |