I would say that you are trying to argue a lot in one test and do not match the name of the test. Instead, consider this:
it "should create a new user" do
lambda do
post :create, @attr
end.should change(User,:count)
end
it "should create a new company" do
lambda do
post :create, @attr
end.should change(Company,:count)
end
In addition, you may not know that it is better to write statements that do the same thing, but read much nicer:
expect {
post :create, @attr
}.to change(Company, :count)
source
share