search for: shoulda

Displaying 20 results from an estimated 79 matches for "shoulda".

Did you mean: should
2010 Aug 11
6
rspec2 not working with shoulda
...ibe User do it { should validate_presence_of(:email) } it { should validate_presence_of(:name) } end Here is my gemfile group :development, :test do gem ''factory_girl_rails'', :git => ''git://github.com/thoughtbot/ factory_girl_rails'' gem ''shoulda'' gem "rspec-rails", "= 2.0.0.beta.19" gem "cucumber-rails", "= 0.3.2" gem "capybara" gem "launchy" end I am getting following error message. Failure/Error: it { should validate_presence_of(:email) } undefined method...
2010 Dec 22
8
Shoulda issue: no more "should have_instance_methods" ?
I''m using Shoulda. After copying the code here.... .... http://joshuaclayton.github.com/code/2009/07/14/should-act-as-list.html.... into my test_helper file so I can test acts_as_list, I came across issues. For one I realized I had to get rid of the _ between the "should" and "have" in past case...
2011 Jul 28
2
RSpec, shoulda-matchers and Rails model attributes validations
...got stopped doing the unit test of a model. In particular, doing the test for the associations and the ActiveRecord validations. I started writing the validations but my tests didn''t look DRY at all. Before refactoring the tests checked out and look for other people solutions. I found out shoulda-matchers and Shoulda (which if I didn''t get it wrong is another testing framework). Actually I found another one, remarkable, but it look it doesn''t work with Rails 3. Does anyone have any advice, comments, suggestion on this matter? Right now I continue on using RSpec and shoul...
2009 Jun 07
6
Missing Template when testing with the Brain Buster Captcha partial
...23 app/views/contacts/_form.html.erb:1 app/views/contacts/edit.html.erb:1 app/controllers/contacts_controller.rb:41:in `update'' functional/contacts_controller_test.rb:80:in `__bind_1244348412_114'' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:271:in `call'' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:271:in `run_current_setup_blocks'' /usr/local/lib/ruby/gems/1.8/gems/thoughtbot-shoulda-2.10.1/ lib/shoulda/context.rb:270:in `each'&...
2011 Mar 01
11
Did rails or shoulda go insane on the inflection of 'taxes'?
I have a model ''xp_jurisdiction_taxes'' which rails (3) created correctly. Another model ''xp_jurisdiction_states'' has many :xp_jurisdiction_taxes. In my spec I am using a shoulda helper to test the association but get the following error. BTW, greped the whole project just in case and the string ''taxi'' exists nowhere. 1) XpJurisdictionStates Failure/Error: it { should have_many(:xp_jurisdiction_taxes) } NameError: uninitialized constant...
2011 Jun 30
2
How to play with shoulda with functional testing
Hi, I am new in rails testing, and now i try to use shoulda to test the functional section. can anyone give me some advice, example or recommend tutorial site to me.. thanks -- 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-/JYPxA39Uh5T...
2009 Mar 03
1
shoulda tested better
...e facebooker tests better. One thing that I think would help is a little better organization and cleanup of the existing test suite. Part of it is just baggage from lots of copying and pasting, but some of it is just inherent to Test::Unit. Would anyone be opposed to moving towards using Shoulda or RSpec for the tests? I think they would allow us to clean up the test suite and make it more accessible to contributors. I''ve personally been a long time fan of RSpec, but I think Shoulda would be a better fit here. Thoughts? Brandon -------------- next part -------------- An...
2010 Jun 15
8
Allow blank on should validate_uniqueness_of
Hello, Using shoulda, any ideas how to allow blank when having this test: should validate_uniqueness_of(:email) Thanks. -- J. Pablo Fernández <pupeno-GAtDADarczzQT0dZR+AlfA@public.gmane.org> (http://pupeno.com) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: T...
2009 Apr 22
15
Why RSpec?
I like Shoulda. Sometimes I like plain old Test::Unit. Cucumber gives me a different thought process. I''d just like to hear some thoughts on why RSpec? What does it buy me that I can''t get with Shoulda? I just can''t seem to think in RSpec. Where is there a good example of RSpec tes...
2011 Sep 05
0
undefined method `dependent' - rspec and shoulda
hello, Getting this error when using shoulda and rspec for model tests. my gemfile ... gem "shoulda-matchers" .. spec file .. it { should have_many(:balances).dependent(:destroy) } error: User shoulda validations Failure/Error: it { should have_many(:balances).dependent(:destroy) } NoMethodError: undefined m...
2011 Oct 15
0
shoulda installation troubles
I cannot manage to have shoulda working. I''m using rvm with rails 3.1 and ruby 1.9.2 I added group :test do gem "shoulda" end to the Gemfile, and then run bundle install, thus the gem is installed, and it is featured in the list running gem list --local. but whenever I add something like class ModelTest &lt...
2008 Jan 10
21
Shoulda
Hey, we''re currently using shoulda (http://dev.thoughtbot.com/ shoulda/) on a project and I saw some things that would be really nice to see in rspec, namely the should_ methods, and especially the should_be_restful method. Do these go against the rspec goals at all? Or could an ambitious programmer go to town implementing...
2011 Sep 14
1
rspec and should have_many through
Hi, Anyone can help me with rspec shoulda validations please. I can''t get the syntax right for these validations. Please correct me it { should have_one :tradable, :through => :trade_order} it { should belong_to :source, :polymorphic => true } it { should have_many :transfers, :as => :source } this is for...
2010 Jan 11
0
test examples using authlogic with shoulda
Hi Is there functional testing examples availbale? This for both login and nonlogin users with or without admin privileges.I Dont know where to start. Kindly help. Tom -- Posted via http://www.ruby-forum.com/. -- 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
2013 Sep 07
0
[shoulda-matchers gem] validate_numericality_of_matcher strange behaviour
Hello I have Vacancy model and vacancy_spec test with validates_numericality_of :salary, greater_than: 1 in the model and validate_numericality_of(:salary).is_greater_than(2) in the _spec. When i run rspec spec command tests pass (in some cases and in other they don''t) Why? vacancy.rb ------------------------ class Vacancy < ActiveRecord::Base validates_presence_of :name,
2011 Jun 30
8
Error of DEPRECATION WARNING
Hi, I Have a strange error when i type the command "rake db:migrate " Can you help to solve this error or give me some advices the error is: DEPRECATION WARNING: Rake tasks in /home/joanne/Desktop/picto/vendor/ plugins/prawnto/tasks/prawnto_tasks.rake are deprecated. Use lib/tasks instead. (called from <top (required)> at /home/joanne/Desktop/picto/ Rakefile:7) thanks for help
2010 Nov 02
7
Testing attr_accessible (and/or attr_protected)
I''ve been puzzling over how to test that attr_accessible has been set for the correct columns; but the tests I''ve come up with so far seem to fail to fail when I expect. I came across this old message from this list: http://www.mail-archive.com/rspec-users at rubyforge.org/msg01570.html Which seemed like a plausible example, but my attempt (modeled on the example)
2011 Jul 11
36
has_many and belongs_to association
...do should have_many :phrases end in language.rb belongs_to :name, :class_name => "Phrase", :foreign_key => "name" error is 1) Failure: test: check has_many and belongs_to association should have many languages. (PhraseTest) [/usr/local/lib/ruby/gems/1.9.1/gems/ shoulda-2.11.3/lib/shoulda/context.rb:324]: Expected Phrase to have a has_many association called languages (Language does not have a phrase_id foreign key.). Expected block to return true value. I dont really understand what it''s warning now.. Yennie -- You received this message because you...
2010 Jun 21
9
[BUG] Segmentation fault
...llowing Gemfile: source ''http://rubygems.org'' gem ''rails'', ''3.0.0.beta4'' gem ''sqlite3-ruby'', :require => ''sqlite3'' group :test do gem "rspec-rails", ">= 2.0.0.beta.12" gem "shoulda", :git => "git://github.com/thoughtbot/shoulda.git" gem ''factory_girl_rails'' gem ''cucumber'' end gem "devise", :git => "git://github.com/plataformatec/devise.git" gem ''cancan'' gem ''redgreen'...
2012 Mar 13
4
minitest validations - is there a cleaner way?
i am trying out minitest, but need some advice on a clean way to test validations. I setup my testing to use minitest by following the following railscast plus i added miniskirt for Factories. http://railscasts.com/episodes/327-minitest-with-rails everything works well, but there has to be a cleaner way of testing failed validations. would i be better off using something besides