diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-12 16:47:06 -0800 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-02-12 16:47:06 -0800 |
commit | 1343b2dfac288eb60d536cc3d1a94de1eb178b51 (patch) | |
tree | 9b593febf0ca24c2ae4c68fa4a44e058dd512f94 /spec/workers | |
parent | f9880c11f754c278cbd00eb34ea65e90160571db (diff) | |
parent | 686000446639fbf0756733c822a1ebb19e09e121 (diff) | |
download | gitlab-ce-1343b2dfac288eb60d536cc3d1a94de1eb178b51.tar.gz |
Merge pull request #8785 from jvanbaarsen/rspec-upgrade
Rspec upgrade
Diffstat (limited to 'spec/workers')
-rw-r--r-- | spec/workers/post_receive_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index 4273fd1019a..8eabc46112b 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe PostReceive do context "as a resque worker" do it "reponds to #perform" do - PostReceive.new.should respond_to(:perform) + expect(PostReceive.new).to respond_to(:perform) end end @@ -13,23 +13,23 @@ describe PostReceive do let(:key_id) { key.shell_id } it "fetches the correct project" do - Project.should_receive(:find_with_namespace).with(project.path_with_namespace).and_return(project) + expect(Project).to receive(:find_with_namespace).with(project.path_with_namespace).and_return(project) PostReceive.new.perform(pwd(project), key_id, changes) end it "does not run if the author is not in the project" do - Key.stub(:find_by).with(hash_including(id: anything())) { nil } + allow(Key).to receive(:find_by).with(hash_including(id: anything())) { nil } - project.should_not_receive(:execute_hooks) + expect(project).not_to receive(:execute_hooks) - PostReceive.new.perform(pwd(project), key_id, changes).should be_false + expect(PostReceive.new.perform(pwd(project), key_id, changes)).to be_falsey end it "asks the project to trigger all hooks" do Project.stub(find_with_namespace: project) - project.should_receive(:execute_hooks) - project.should_receive(:execute_services) - project.should_receive(:update_merge_requests) + expect(project).to receive(:execute_hooks) + expect(project).to receive(:execute_services) + expect(project).to receive(:update_merge_requests) PostReceive.new.perform(pwd(project), key_id, changes) end |