it “should have a unique email address” do @valid_user.save.should == true @user.email = @valid_user.email @user.should have(1).error_on(:email)
end
it “should allow two users with the same name” do @valid_user.save.should == true @user.fname = @valid_user.fname @user.lname = @valid_user.lname @user.should have(:no).error_on(:fname) @user.should have(:no).error_on(:lname)
end
end
The second example now fails, as the inserted record from the first
example
is not rolled back.
I can just put a User.delete_all in an after(:each) block but I think it
would be nicer if Rspec wrapped each example in a db transaction. Wasn’t
this they way things worked in 1.08 ?
Pending:
A valid user should add the correct error on dob when using an bogus dob
assignment (with only a month) (met max dob is beetje lastig op win32
lijkt
het :-s)
‘A user should allow two users with the same name’ FAILED
expected: true,
got: false (using ==)
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/expectations.rb:52:i
n fail_with' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers/operator_ma tcher.rb:46:infail_with_message’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers/operator_ma
tcher.rb:56:in __delegate_method_missing_to_target' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers/operator_ma tcher.rb:12:in==’
./spec/models/user_spec.rb:36:
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth
ods.rb:79:in instance_eval' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:79:inrun_with_description_capturing’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/matchers.rb:144:in capture_generated_description' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth ods.rb:78:inrun_with_description_capturing’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth
ods.rb:19:in execute' /usr/local/lib/ruby/1.8/timeout.rb:48:intimeout’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_meth
ods.rb:16:in execute' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou p_methods.rb:280:inexecute_examples’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou
p_methods.rb:279:in each' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou p_methods.rb:279:inexecute_examples’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/example/example_grou
p_methods.rb:120:in run' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/example_group _runner.rb:22:inrun’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/example_group
_runner.rb:21:in each' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/example_group _runner.rb:21:inrun’
/Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/options.rb:87
:in run_examples' /Users/jeroen/lostboys.nl/vendor/plugins/rspec/lib/spec/runner/command_line. rb:19:inrun’
./script/spec:4:
end @user.lname = @valid_user.lname
I don’t see a fixtures :users in your spec. Do you have this in your
spec_helper?
Have you rerun script/generate rspec after you upgraded? There are
some changes in the spec_helper.rb file between the two releases.
This is actually a regression in 1.1.0 that has been fixed in trunk.
We’ll do a 1.1.1 release later today, but go ahead and update to trunk
for the time being and you should be good.
it “should have a unique email address” do @user.should have(:no).error_on(:lname)
end
end
The second example now fails, as the inserted record from the first example
is not rolled back.
I don’t see a fixtures :users in your spec. Do you have this in your
spec_helper?
Have you rerun script/generate rspec after you upgraded? There are
some changes in the spec_helper.rb file between the two releases.
This is actually a regression in 1.1.0 that has been fixed in trunk.
We’ll do a 1.1.1 release later today, but go ahead and update to trunk
for the time being and you should be good.
Great, thanks. Will I get 1.1.1 automatically if I’m using svn:externals and
the CURRENT tag?
This is actually a regression in 1.1.0 that has been fixed in trunk.
We’ll do a 1.1.1 release later today, but go ahead and update to trunk
for the time being and you should be good.
Great, thanks. Will I get 1.1.1 automatically if I’m using svn:externals
and
the CURRENT tag?
I’ve added some more functional specs (r3172) that should prevent any
transaction related bugs from coming back in.
Jeroen - if you find more bugs, please report what Rails and Ruby
versions you are using - it took me a while to realise that you were
on Rails 1.2.3 (David told me)
Finished in 3.42683 seconds
I didn’t look and don’t have time right now. The fix was committed in
r3158. Can you check the diff?
I’ve added some more functional specs (r3172) that should prevent any
transaction related bugs from coming back in.
Jeroen - if you find more bugs, please report what Rails and Ruby
versions you are using - it took me a while to realise that you were
on Rails 1.2.3 (David told me)
Don’t know if it makes a difference, but I was on 1.2.6
Cheers,
Jeroen
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.