spec/zertico/controller_integration_spec.rb in zertico-2.0.0.alpha.3 vs spec/zertico/controller_integration_spec.rb in zertico-2.0.0.beta.1
- old
+ new
@@ -52,12 +52,12 @@
before :each do
post :create, :user => { :name => 'name' }
end
it 'should pass the right parameters to the model' do
- expect(User).to receive(:create).with(:name => 'name').and_return(user)
- post :create, :user => { :name => 'name' }
+ expect(User).to receive(:create).with(:first_name => 'name').and_return(user)
+ post :create, :user => { :first_name => 'name' }
end
it 'should create a new user' do
expect(assigns(:user)).to be_an_instance_of(User)
end
@@ -65,15 +65,15 @@
context '#update' do
before :each do
allow(User).to receive(:find).and_return(user)
allow(user).to receive(:id).and_return(3)
- put :update, :id => 1, :user => { :id => 23 }
+ put :update, :id => 1, :user => { :last_name => 'teste' }
end
it 'should pass the right parameters to the model' do
- expect(user).to receive(:update_attributes).with('id' => '23').and_return(true)
- put :update, :id => 1, :user => { :id => 23 }
+ expect(user).to receive(:update_attributes).with('last_name' => 'teste').and_return(true)
+ put :update, :id => 1, :user => { :last_name => 'teste' }
end
it 'should update an user' do
expect(assigns(:user)).to be_an_instance_of(User)
end
\ No newline at end of file