Sha256: ad10160bc2e93874ecc2bc9c534e666b219ee94cecf861149f1098db6c026e35

Contents?: true

Size: 646 Bytes

Versions: 26

Compression:

Stored size: 646 Bytes

Contents

Feature: ActiveRecord::Relation match array

  The `=~` matcher can be used with an `ActiveRecord::Relation` (scope). The
  assertion will pass if the scope would return all of the elements specified
  in the array on the right hand side.

  Scenario: example spec with relation =~ matcher
    Given a file named "spec/models/widget_spec.rb" with:
      """
      require "spec_helper"

      describe Widget do
        let!(:widgets) { Array.new(3) { Widget.create } }
        subject { Widget.scoped }

        it { should =~ widgets }
      end
      """
    When I run `rspec spec/models/widget_spec.rb`
    Then the examples should all pass

Version data entries

26 entries across 21 versions & 4 rubygems

Version Path
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.feature
rspec-rails-2.11.4 features/matchers/relation_match_array.feature
gem_repackager-0.1.0 support/gems/rspec-rails-2.11.0/features/matchers/relation_match_array.feature
rspec-rails-2.11.0 features/matchers/relation_match_array.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/matchers/relation_match_array.feature
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.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/matchers/relation_match_array.feature
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.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/matchers/relation_match_array.feature
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.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/matchers/relation_match_array.feature
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.feature
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.feature
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.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/matchers/relation_match_array.feature
rails-uploader-0.0.1 vendor/bundle/ruby/1.9.1/gems/rspec-rails-2.10.1/features/matchers/relation_match_array.feature
rspec-rails-2.10.1 features/matchers/relation_match_array.feature
rspec-rails-2.10.0 features/matchers/relation_match_array.feature
rspec-rails-2.9.0 features/matchers/relation_match_array.feature
rspec-rails-2.9.0.rc2 features/matchers/relation_match_array.feature