Skip to content

Commit

Permalink
Ensure memory adapted is able to find a record for a string id
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Feb 15, 2014
1 parent 278f898 commit c2b94e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lotus/model/adapters/memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def all
end

def find(id)
records[id]
records[id.to_i]
end

def first
Expand Down
3 changes: 2 additions & 1 deletion test/model/repository_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@
UserRepository.create(user2)
end

it 'returns first record' do
it 'returns the record associated with the given id' do
UserRepository.find(user1.id).must_equal(user1)
UserRepository.find(user2.id.to_s).must_equal(user2)
end
end
end
Expand Down

0 comments on commit c2b94e0

Please sign in to comment.