Sha256: 808bb3f3c33f30c848d7947ea34e2b2c6c0ce94632e5c91297bb9273608dd1e0

Contents?: true

Size: 1.03 KB

Versions: 18

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
        attr_accessible :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

18 entries across 13 versions & 4 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
rspec-rails-2.11.4 features/model_specs/errors_on.feature
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/features/model_specs/errors_on.feature
rspec-rails-2.11.0 features/model_specs/errors_on.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/model_specs/errors_on.feature
rspec-rails-2.10.1 features/model_specs/errors_on.feature
rspec-rails-2.10.0 features/model_specs/errors_on.feature