Note that there are some explanatory texts on larger screens.

plurals
  1. PORspec unit test case getting failed
    primarykey
    data
    text
    <p>I have written some Rspec test cases in my spec/models/season_spec.rb file. They are as:-</p> <pre><code>require 'spec_helper' describe Season do it 'should not be without name' do Season.new(:name=&gt;nil,:number_of_weeks=&gt;'3',:start_date=&gt;'2012-02-07',:user_id=&gt;'113').should_not be_valid end it 'should not be without number of weeks' do Season.new(:name=&gt;'Apurva',:number_of_weeks=&gt;nil,:start_date=&gt;'2012-02-07',:user_id=&gt;'113').should_not be_valid end it 'should not be without start_date' do Season.new(:name=&gt;'Apurva',:number_of_weeks=&gt;'3',:start_date=&gt;nil,:user_id=&gt;'113').should_not be_valid end it 'should not be without user_id' do Season.new(:name=&gt;'Apurva',:number_of_weeks=&gt;'3',:start_date=&gt;'2012-02-07',:user_id=&gt;nil).should_not be_valid end it 'should be with valid attributes' do Season.new(:name=&gt;'Apurva',:number_of_weeks=&gt;'3',:start_date=&gt;'2012-02-07',:user_id=&gt;'113').should be_valid end end </code></pre> <p>And in my model i have validated these fields as :- </p> <pre><code>class Season &lt; ActiveRecord::Base validates_presence_of :name,:number_of_weeks,:start_date,:user_id end </code></pre> <p>But still the test cases are failed. And it is giving me following output:-</p> <pre><code>/usr/lib/ruby/gems/1.8/gems/bundler-1.0.21/lib/bundler/runtime.rb:138: warning: Insecure world writable dir /usr/lib/ruby/gems/1.8 in PATH, mode 040777 FFFFF Failures: /usr/lib/ruby/gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:165:in `pending_fixed?': undefined method `pending_fixed?' for #&lt;ActiveRecord::StatementInvalid:0xb6cd03c8&gt; (NoMethodError) from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:19:in `dump_failures' from /usr/lib/ruby/gems/1.8/bundler/gems/rails-27357a6965eb/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:473:in `each_with_index' from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `each' from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `each_with_index' from /usr/lib/ruby/gems/1.8/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `dump_failures' from /usr/lib/ruby/vendor_ruby/rspec/core/reporter.rb:75:in `send' from /usr/lib/ruby/vendor_ruby/rspec/core/reporter.rb:75:in `notify' from /usr/lib/ruby/vendor_ruby/rspec/core/reporter.rb:74:in `each' from /usr/lib/ruby/vendor_ruby/rspec/core/reporter.rb:74:in `notify' from /usr/lib/ruby/vendor_ruby/rspec/core/reporter.rb:23:in `conclude' from /usr/lib/ruby/vendor_ruby/rspec/core/reporter.rb:14:in `report' from /usr/lib/ruby/vendor_ruby/rspec/core/command_line.rb:24:in `run' from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:55:in `run_in_process' from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:46:in `run' from /usr/lib/ruby/vendor_ruby/rspec/core/runner.rb:10:in `autorun' from /usr/bin/rspec:4 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload