Commit 2ab76ca5316d815e5cdb03782ff919397d343b26
1 parent
d75eb243
Exists in
master
and in
4 other branches
Fix UserProject obserse spec
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
4 additions
and
8 deletions
Show diff stats
app/observers/users_project_observer.rb
spec/observers/users_project_observer_spec.rb
... | ... | @@ -7,7 +7,7 @@ describe UsersProjectObserver do |
7 | 7 | let(:user) { create(:user) } |
8 | 8 | let(:project) { create(:project) } |
9 | 9 | subject { UsersProjectObserver.instance } |
10 | - before { subject.stub(notification: mock('NotificationService').as_null_object) } | |
10 | + before { subject.stub(notification: double('NotificationService').as_null_object) } | |
11 | 11 | |
12 | 12 | describe "#after_commit" do |
13 | 13 | it "should called when UsersProject created" do |
... | ... | @@ -35,7 +35,7 @@ describe UsersProjectObserver do |
35 | 35 | end |
36 | 36 | |
37 | 37 | it "should called when UsersProject updated" do |
38 | - subject.should_receive(:after_commit) | |
38 | + subject.should_receive(:after_update) | |
39 | 39 | @users_project.update_attribute(:project_access, UsersProject::MASTER) |
40 | 40 | end |
41 | 41 | |
... | ... | @@ -45,7 +45,7 @@ describe UsersProjectObserver do |
45 | 45 | end |
46 | 46 | |
47 | 47 | it "should not called after UsersProject destroyed" do |
48 | - subject.should_not_receive(:after_commit) | |
48 | + subject.should_not_receive(:after_update) | |
49 | 49 | @users_project.destroy |
50 | 50 | end |
51 | 51 | end |
... | ... | @@ -91,4 +91,4 @@ describe UsersProjectObserver do |
91 | 91 | end |
92 | 92 | end |
93 | 93 | end |
94 | -end | |
95 | 94 | \ No newline at end of file |
95 | +end | ... | ... |