Update specs to new rspec syntax

This commit is contained in:
Thibault Jouan
2014-04-01 18:15:44 +00:00
parent 99d106cf36
commit 4cef7aeab9
32 changed files with 173 additions and 179 deletions

View File

@@ -11,14 +11,14 @@ describe TracksController do
it 'assigns the requested track as @track' do
track = FactoryGirl.create(:track)
get :show, id: track.id.to_s
assigns[:track].should == track
expect(assigns[:track]).to eq track
end
end
describe 'GET new' do
it 'assigns a new track as @track' do
get :new
assigns[:track].should be_a_new(Track)
expect(assigns[:track]).to be_a_new Track
end
end
@@ -41,23 +41,23 @@ describe TracksController do
it 'redirects to the track page' do
do_create
response.should redirect_to(Track.last)
expect(response).to redirect_to Track.last
end
end
context 'whith invalid params' do
before do
Track.any_instance.stub(:save).and_return(false)
allow_any_instance_of(Track).to receive(:save) { false }
end
it 'assigns the track as @track' do
do_create
assigns[:track].should be_a_new(Track)
expect(assigns[:track]).to be_a_new Track
end
it 'renders the new template' do
do_create
response.should render_template('new')
expect(response).to render_template 'new'
end
end
end