This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert specs to RSpec 3.0.2 syntax with Transpec
This conversion is done by Transpec 1.13.1 with the following command: transpec * 73 conversions from: obj.should to: expect(obj).to Convert specs to RSpec 3.0.2 syntax with Transpec This conversion is done by Transpec 2.3.1 with the following command: transpec -f * 6 conversions from: obj.stub(:message => value) to: allow(obj).to receive_messages(:message => value) * 5 conversions from: obj.should_receive(:message) to: expect(obj).to receive(:message) * 1 conversion from: describe 'some controller' { } to: describe 'some controller', :type => :controller { } For more details: https://github.com/yujinakayama/transpec#supported-conversions
- Loading branch information
1 parent
e5783ec
commit 47ab10f
Showing
7 changed files
with
96 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,14 +44,14 @@ def fixture_file | |
Array.wrap(normalized_params).each do |params| | ||
email = Griddler::Email.new(params) | ||
|
||
email.to.should eq([{ | ||
expect(email.to).to eq([{ | ||
token: 'hi', | ||
host: 'example.com', | ||
full: 'Hello World <[email protected]>', | ||
email: '[email protected]', | ||
name: 'Hello World', | ||
}]) | ||
email.cc.should eq [{ | ||
expect(email.cc).to eq [{ | ||
token: 'emily', | ||
host: 'example.com', | ||
email: '[email protected]', | ||
|
@@ -81,8 +81,8 @@ def fixture_file | |
match do |actual| | ||
expected.each do |k, v| | ||
case v | ||
when Regexp then actual[k].should =~ v | ||
else actual[k].should === v | ||
when Regexp then expect(actual[k]).to =~ v | ||
else expect(actual[k]).to === v | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
require 'spec_helper' | ||
|
||
describe Griddler::EmailsController do | ||
describe Griddler::EmailsController, :type => :controller do | ||
before(:each) do | ||
fake_adapter = double(normalize_params: normalized_params) | ||
Griddler.adapter_registry.register(:one_that_works, fake_adapter) | ||
|
@@ -11,12 +11,12 @@ | |
it 'is successful' do | ||
post :create, email_params | ||
|
||
response.should be_success | ||
expect(response).to be_success | ||
end | ||
|
||
it 'creates a new Griddler::Email with the given params' do | ||
email = double | ||
Griddler::Email.should_receive(:new). | ||
expect(Griddler::Email).to receive(:new). | ||
with(hash_including(to: ['[email protected]'])). | ||
and_return(email) | ||
|
||
|
@@ -25,18 +25,18 @@ | |
|
||
it 'calls process on the custom processor class' do | ||
my_handler = double(process: nil) | ||
my_handler.should_receive(:new).and_return(my_handler) | ||
Griddler.configuration.stub(processor_class: my_handler) | ||
expect(my_handler).to receive(:new).and_return(my_handler) | ||
allow(Griddler.configuration).to receive_messages(processor_class: my_handler) | ||
|
||
post :create, email_params | ||
end | ||
|
||
it 'calls the custom processor method on the processor class' do | ||
Griddler.configuration.stub(processor_method: :perform) | ||
allow(Griddler.configuration).to receive_messages(processor_method: :perform) | ||
fake_processor = double(perform: nil) | ||
|
||
EmailProcessor.should_receive(:new).and_return(fake_processor) | ||
fake_processor.should_receive(:perform) | ||
expect(EmailProcessor).to receive(:new).and_return(fake_processor) | ||
expect(fake_processor).to receive(:perform) | ||
|
||
post :create, email_params | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.