Skip to content

Commit

Permalink
Add tests for any options with utusemi method
Browse files Browse the repository at this point in the history
  • Loading branch information
YOSHIDA Hiroki committed Jul 16, 2014
1 parent 0be7878 commit 0ac3a93
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/lib/utusemi/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,20 @@
expect(subject.where.not(description: nil).count).to eq(1)
end
end

describe 'any options' do
let!(:product) { FactoryGirl.create(:product, description1: '1', description2: '2', description3: '3') }

before do
Utusemi.configure do
map(:sample) { |options| description "description#{options[:default_description_no]}" }
end
end

subject { Product.utusemi(:sample, default_description_no: 2).first }

it 'read description2 value' do
expect(subject.description).to eq('2')
end
end
end

0 comments on commit 0ac3a93

Please sign in to comment.