Sha256: 3f84e2fc17c61853937afcc4cbc9a231745eba263e8913282c2a94aed8a991a7
Contents?: true
Size: 1.03 KB
Versions: 15
Compression:
Stored size: 1.03 KB
Contents
Feature: errors_on Scenario: with one validation error Given a file named "spec/models/widget_spec.rb" with: """ require "spec_helper" class ValidatingWidget < ActiveRecord::Base set_table_name :widgets validates_presence_of :name end describe ValidatingWidget do it "fails validation with no name (using error_on)" do ValidatingWidget.new.should have(1).error_on(:name) end it "fails validation with no name (using errors_on)" do ValidatingWidget.new.should have(1).errors_on(:name) end it "passes validation with a name (using 0)" do ValidatingWidget.new(:name => "liquid nitrogen").should have(0).errors_on(:name) end it "passes validation with a name (using :no)" do ValidatingWidget.new(:name => "liquid nitrogen").should have(:no).errors_on(:name) end end """ When I run "rspec spec/models/widget_spec.rb" Then the output should contain "4 examples, 0 failures"
Version data entries
15 entries across 15 versions & 1 rubygems