Sha256: bd4a1ca2eb548baffe509705a385dceda6bbb160791c18bcc927b741dc5bcea4

Contents?: true

Size: 1 KB

Versions: 14

Compression:

Stored size: 1 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 examples should all pass

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rspec-rails-2.9.0 features/model_specs/errors_on.feature
rspec-rails-2.9.0.rc2 features/model_specs/errors_on.feature
rspec-rails-2.8.1 features/model_specs/errors_on.feature
rspec-rails-2.8.0 features/model_specs/errors_on.feature
rspec-rails-2.8.0.rc2 features/model_specs/errors_on.feature
rspec-rails-2.8.0.rc1 features/model_specs/errors_on.feature
rspec-rails-2.7.0 features/model_specs/errors_on.feature
rspec-rails-2.7.0.rc1 features/model_specs/errors_on.feature
rspec-rails-2.6.1 features/model_specs/errors_on.feature
rspec-rails-2.6.1.beta1 features/model_specs/errors_on.feature
rspec-rails-2.6.0 features/model_specs/errors_on.feature
rspec-rails-2.6.0.rc6 features/model_specs/errors_on.feature
rspec-rails-2.6.0.rc4 features/model_specs/errors_on.feature
rspec-rails-2.6.0.rc2 features/model_specs/errors_on.feature