search for: should_not_be_valid

Displaying 7 results from an estimated 7 matches for "should_not_be_valid".

2007 Apr 09
10
changes in 0.8 and greater - should_
Has the should_... syntax changed? I''m getting errors when running the following: should_render(:index) should_be_valid should_not_be_valid should_respond_to should_be should_render I thought the syntax changed to something like the following: obj.should render(:index) but this doesn''t seem to work. Scott
2007 Jan 01
5
Validations based on associations
...er, :tournament => @tournament) end specify "should be valid" do @reg.should_be_valid end specify "should not be valid if a registration with the same details already exists" do @reg.save Registration.new(:user => @user, :tournament => @tournament).should_not_be_valid end end Well actually that''s obviously pretty easy :) Is it bad that I''m tied to the implementations of User and Tournament at all? ActiveRecord dictates that, so I guess it''s not a problem to have that in my spec at all. Anyway this is just the spec I came up with...
2011 Jul 05
7
error of "rake test" command
...method Pictographs::Application#task called at /usr/local/ lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/application.rb: 215:in `initialize_tasks'' /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.7/lib/ active_support/whiny_nil.rb:48:in `method_missing'': undefined method `should_not_be_valid'' for nil:NilClass (NoMethodError) Thank you very much Yennie -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To u...
2009 Jan 16
3
rspec model testing - test on user defined validation- How do I test that the create failed.
I''m new to rspec and looking for way to test a validation I added to a model. The test checks to see that if field1 has a value then field2 must be nil and vice versa. ------------------------------- When I did the rspec_scaffold it generated one test which worked before :each do @valid_attributes = { :field1 = "value for field1" :field2 = "value for
2006 Oct 24
5
Radrails and RSpec
Hi all, Does anyone know how to get radrails to use RSpec specs instead of tests? Cheers --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to
2006 Nov 30
41
TDD killing my joy of Rails
I''ve been working through the book ''Beginning Ruby on Rails E-Commerce'' which is very heavy on Test Driven Development. As in, you have to write tests for scaffolding methods and validations and crap like that. And then they fail. And you KNOW its the test not the method. So you spend 2x the time writing a test that has to be adapted when requirements change. You
2007 Feb 13
16
Error against latest trunk while testing via spec for model
Hi I just did an update to lates trunk ================= context "Given a generated venue_spec.rb with fixtures loaded" do fixtures :venues specify "fixtures should load two Venues" do Venue.should have(2).records end end ================== gives me ========== 1) TypeError in ''Given a generated venue_spec.rb with fixtures loaded fixtures should load two