spec/support/shared_group.rb in hungryform-0.0.2 vs spec/support/shared_group.rb in hungryform-0.0.4
- old
+ new
@@ -11,22 +11,28 @@
end
describe "#group" do
it "creates a nested group" do
group.group(:nested, {}) {}
- expect(group.elements.first.class).to eq HungryForm::Group
+ expect(group.elements.first.class).to eq HungryForm::Elements::Group
end
it "concatenates nested element's name with the parent's one" do
group.group(:nested, {}) {}
expect(group.elements.first.name).to eq "parent_name_name_nested"
end
end
+ describe "#to_hash" do
+ it "should include group elements" do
+ expect(group.to_hash).to include(:elements)
+ end
+ end
+
describe ".method_missing" do
it "creates a nested element" do
group.html(:name)
- expect(group.elements.first.class).to eq HungryForm::Html
+ expect(group.elements.first.class).to eq HungryForm::Elements::Html
end
it "concatenates nested element's name with the parent's one" do
group.html(:html)
expect(group.elements.first.name).to eq "parent_name_name_html"
\ No newline at end of file