summaryrefslogtreecommitdiff
path: root/spec/models/concerns/issuable_spec.rb
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-01 00:14:53 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-11-17 15:10:13 -0200
commit091efb315296306fd8c8d7c109ad6df77e7f28d5 (patch)
treeca78c1e5c9229eed679657cc26cfdfa0cb94c8c2 /spec/models/concerns/issuable_spec.rb
parent48d851d2015c3cb901498455862176eb15be3a0f (diff)
downloadgitlab-ce-091efb315296306fd8c8d7c109ad6df77e7f28d5.tar.gz
Fix specs to pass a project when creating subscriptions
Diffstat (limited to 'spec/models/concerns/issuable_spec.rb')
-rw-r--r--spec/models/concerns/issuable_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/models/concerns/issuable_spec.rb b/spec/models/concerns/issuable_spec.rb
index 6e987967ca5..e8fead767f2 100644
--- a/spec/models/concerns/issuable_spec.rb
+++ b/spec/models/concerns/issuable_spec.rb
@@ -176,6 +176,8 @@ describe Issue, "Issuable" do
end
describe '#subscribed?' do
+ let(:project) { issue.project }
+
context 'user is not a participant in the issue' do
before { allow(issue).to receive(:participants).with(user).and_return([]) }
@@ -184,13 +186,13 @@ describe Issue, "Issuable" do
end
it 'returns true when a subcription exists and subscribed is true' do
- issue.subscriptions.create(user: user, subscribed: true)
+ issue.subscriptions.create(user: user, project: project, subscribed: true)
expect(issue.subscribed?(user)).to be_truthy
end
it 'returns false when a subcription exists and subscribed is false' do
- issue.subscriptions.create(user: user, subscribed: false)
+ issue.subscriptions.create(user: user, project: project, subscribed: false)
expect(issue.subscribed?(user)).to be_falsey
end
@@ -204,13 +206,13 @@ describe Issue, "Issuable" do
end
it 'returns true when a subcription exists and subscribed is true' do
- issue.subscriptions.create(user: user, subscribed: true)
+ issue.subscriptions.create(user: user, project: project, subscribed: true)
expect(issue.subscribed?(user)).to be_truthy
end
it 'returns false when a subcription exists and subscribed is false' do
- issue.subscriptions.create(user: user, subscribed: false)
+ issue.subscriptions.create(user: user, project: project, subscribed: false)
expect(issue.subscribed?(user)).to be_falsey
end