Skip to content

Commit

Permalink
Add failing test fixed by #110
Browse files Browse the repository at this point in the history
  • Loading branch information
mpokrywka committed Sep 7, 2016
1 parent 5fd725b commit 37e19f8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/duck-model/duck_spec.rb
Expand Up @@ -603,6 +603,34 @@

end

context "from position without gaps with rebalance" do

before {
[:quacky, :feathers, :wingy, :webby, :waddly, :beaky].each_with_index do |name, i|
Duck.where(id: @ducks[name].id).update_all(row: i)
@ducks[name].reload
end
@ducks[:wingy].update_attribute :row_position, :up
}

context {

subject { Duck.ranker(:row).with(Duck.new).current_at_position(1).instance }

its(:id) { should == @ducks[:wingy].id }

}

context {

subject { Duck.ranker(:row).with(Duck.new).current_at_position(2).instance }

its(:id) { should == @ducks[:feathers].id }

}

end

end

describe "up with string" do
Expand Down

0 comments on commit 37e19f8

Please sign in to comment.