Sha256: 9c9ae5b982bf26eb8fcbe9dcf3e07893aac3bccc4c4d5aa99e4beb605d4e5d4b

Contents?: true

Size: 887 Bytes

Versions: 12

Compression:

Stored size: 887 Bytes

Contents

require 'spec_helper'

describe WrongScopeDuck do

  it "should raise an error because of an unknown scope" do

    expect {
      WrongScopeDuck.create(:name => 'Quocky', :pond => 'Shin')
    }.to raise_error(RankedModel::InvalidScope, 'No scope called "non_existant_scope" found in model')

  end

end

describe WrongFieldDuck do

  it "should raise an error because of an unknown field" do

    expect {
      WrongFieldDuck.create(:name => 'Quicky', :pond => 'Shin')
    }.to raise_error(RankedModel::InvalidField, 'No field called "non_existant_field" found in model')

  end

end

describe ReallyWrongFieldDuck do

  it "should raise an error because of a specific unknown field" do

    expect {
      ReallyWrongFieldDuck.create(:name => 'Quicky', :pond => 'Shin')
    }.to raise_error(RankedModel::InvalidField, 'No field called "non_existant_field" found in model')
  end

end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
ranked-model-0.4.11 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.10 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.9 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.8 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.7 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.6 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.5 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.4 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.3 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.2 spec/duck-model/wrong_ducks_spec.rb
ranked-model-0.4.1 spec/duck-model/wrong_ducks_spec.rb
ranked-model-rails2-0.4.0 spec/duck-model/wrong_ducks_spec.rb