Sha256: 2423479780d923dbce22b00a0a620eed732be6393b23fd6612cc9446d2185586

Contents?: true

Size: 401 Bytes

Versions: 23

Compression:

Stored size: 401 Bytes

Contents

require "spec_helper"

describe "be_new_record" do
  include RSpec::Rails::Matchers

  context "un-persisted record" do
    it "passes" do
      record = double('record', :persisted? => false)
      record.should be_new_record
    end
  end

  context "persisted record" do
    it "fails" do
      record = double('record', :persisted? => true)
      record.should_not be_new_record
    end
  end
end

Version data entries

23 entries across 18 versions & 4 rubygems

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