Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Commit

Permalink
Merge 7e95b33 into a39c34f
Browse files Browse the repository at this point in the history
  • Loading branch information
allolex committed Jun 6, 2014
2 parents a39c34f + 7e95b33 commit 02fd7ad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/nacre/order/assignment_collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
module Nacre
class Order::AssignmentCollection < AbstractCollection

def current
members.select { |assignment| assignment.key == :current }.first
end

def self.resource_class
Nacre::Order::Assignment
end
Expand Down
6 changes: 6 additions & 0 deletions spec/lib/nacre/order/assignment_collection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@
it 'should be a collection of Order::AssignmentDetails' do
expect(subject.first).to be_a(Nacre::Order::Assignment)
end

describe '#current' do
it 'should returnt the current assignment' do
expect(subject.current.key).to eq(:current)
end
end
end
1 change: 0 additions & 1 deletion spec/lib/nacre/order/assignment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

it 'should have an assignment key' do
expect(subject.key).to eq('current')

end

it 'should have a channel ID' do
Expand Down

0 comments on commit 02fd7ad

Please sign in to comment.