Sha256: e9f1377e2bd111d5fb134b772d7211fcf515583ece856ec1b826b846c7a5a464

Contents?: true

Size: 584 Bytes

Versions: 7

Compression:

Stored size: 584 Bytes

Contents

require 'spec_helper'

describe Player do

  before {
    @players = {}
    @players[:dave] = Player.create!(:name => "Dave", :city => "Detroit")
    @players[:bob] = Player.create!(:name => "Bob", :city => "Portland")
    @players[:nigel] = Player.create!(:name => "Nigel", :city => "New York")
    Player.class_eval do
      include RankedModel
      ranks :score
    end

  }

  describe "setting the position of a record that already exists" do
    it "sets the rank without error" do
      expect{@players[:bob].update! :score_position => 1}.to_not raise_error
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ranked-model-0.4.11 spec/player-model/records_already_exist_spec.rb
ranked-model-0.4.10 spec/player-model/records_already_exist_spec.rb
ranked-model-0.4.9 spec/player-model/records_already_exist_spec.rb
ranked-model-0.4.8 spec/player-model/records_already_exist_spec.rb
ranked-model-0.4.7 spec/player-model/records_already_exist_spec.rb
ranked-model-0.4.6 spec/player-model/records_already_exist_spec.rb
ranked-model-0.4.5 spec/player-model/records_already_exist_spec.rb