spec/conglomerate_spec.rb in conglomerate-0.1.0 vs spec/conglomerate_spec.rb in conglomerate-0.1.1
- old
+ new
@@ -16,10 +16,13 @@
roster_url(item.roster_id)
end
attribute :team_ids, :rel => :teams do |item|
team_url(item.team_ids.join(","))
end
+ attribute :user_ids, :rel => :users do |item|
+ user_url(item.user_ids.join(","))
+ end
link :events do
events_url
end
@@ -44,11 +47,12 @@
"Object",
:id => 1,
:description => "Tasty Burgers",
:event_id => 2,
:roster_id => nil,
- :team_ids => [1,2]
+ :team_ids => [1,2],
+ :user_ids => []
)
end
let(:context) do
request = double("Request", :original_url => "https://example.com/items")
@@ -150,10 +154,11 @@
"data" => [
{"name" => "description", "value" => "Tasty Burgers"},
{"name" => "id", "value" => 1},
{"name" => "event_id", "value" => 2},
{"name" => "roster_id", "value" => nil},
- {"name" => "team_ids", "value" => [1,2]}
+ {"name" => "team_ids", "value" => [1,2]},
+ {"name" => "user_ids", "value" => []}
],
"links" => [
{"rel" => "event", "href" => "https://example.com/events/2"},
{"rel" => "teams", "href" => "https://example.com/teams/1,2"}
]