Skip to content

Commit

Permalink
Possible fix for Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
kostyantyn committed Mar 30, 2014
1 parent 0c2d350 commit 5186c9c
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions spec/hydra_attribute/active_record_spec.rb
Expand Up @@ -16,19 +16,29 @@
it 'returns hydra associations with loaded hydra attributes' do
rooms = flat.rooms
expect(rooms).to match_array([room1, room2])
expect(rooms.map(&:attributes)).to match_array([room1.attributes, room2.attributes])

attributes = [rooms[0].attributes.except('updated_at', 'created_at')]
attributes << rooms[1].attributes.except('updated_at', 'created_at')
expect(attributes).to match_array([
room1.attributes.except('updated_at', 'created_at'),
room2.attributes.except('updated_at', 'created_at')
])
end

it 'returns hydra associations filtered by hydra attribute' do
rooms = flat.rooms.where(length: 5, width: 9)
expect(rooms).to match_array([room2])
expect(rooms.first.attributes).to eq(room2.attributes)
expect(rooms.first.length).to eq(5)
expect(rooms.first.width).to eq(9)
expect(rooms.first.square).to eq(45)
end

it 'returns hydra associations with filter by static attribute' do
rooms = flat.rooms.where(square: 40)
expect(rooms).to match_array([room1])
expect(rooms.first.attributes).to eq(room1.attributes)
expect(rooms.first.length).to eq(5)
expect(rooms.first.width).to eq(8)
expect(rooms.first.square).to eq(40)
end
end

Expand Down Expand Up @@ -82,7 +92,8 @@

it 'returns hydra association' do
expect(room.flat).to eq(flat)
expect(room.flat.attributes).to eq(flat.attributes)
expect(room.flat.number).to be(100)
expect(room.flat.floor).to be(5)
end
end

Expand Down

0 comments on commit 5186c9c

Please sign in to comment.