spec/conglomerate_spec.rb in conglomerate-0.3.1 vs spec/conglomerate_spec.rb in conglomerate-0.4.0
- old
+ new
@@ -5,11 +5,11 @@
include Conglomerate.serializer
href { test_url }
item_href { |item| item_url(item.id) }
- attribute :description, :template => true
+ attribute :description, :template => true, :prompt => "awesome"
attribute :id
attribute :event_id, :rel => :event do |item|
event_url(item.event_id)
end
attribute :roster_id, :rel => :roster do |item|
@@ -27,10 +27,12 @@
end
query :search, :data => :id do
search_items_url
end
+
+ template :repeats, :prompt => "true|false"
end
class ConglomerateExtraTestSerializer
include Conglomerate.serializer
@@ -187,10 +189,11 @@
end
it "includes a valid template if attributes have them" do
expect(test_collection["template"]["data"]).to match_array(
[
- {"name" => "description", "value" => ""}
+ {"name" => "description", "value" => "", "prompt" => "awesome"},
+ {"name" => "repeats", "value" => "", "prompt" => "true|false"}
]
)
end
end
end