Guest User

Untitled

a guest
Jun 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. it 'returns the options field when empty' do
  2. valid_asset = FactoryGirl.create(:asset)
  3. asset_mappings = [
  4. {
  5. isbn_canonical: valid_asset.isbn_canonical,
  6. partner_id: partner_id,
  7. options: {}
  8. }
  9. ]
  10.  
  11. binding.pry
  12. post(:create, params: { feature_id: feature.id, asset_mappings: asset_mappings, format: :json })
  13.  
  14. response.status.must_equal(200)
  15.  
  16. asset_feature = json['asset_features'].first
  17. asset_feature['id'].wont_be_nil
  18. asset_feature['feature_id'].must_equal(feature.id)
  19. asset_feature['asset_id'].must_equal(valid_asset.id)
  20. asset_feature['partner_id'].must_equal(partner_id)
  21. asset_feature['options'].must_equal(JSON.parse('{}'))
  22. end
Add Comment
Please, Sign In to add comment