Sha256: 8bbd822a8ec886a7ec8fe26c88405e53cc1ae8d86c71a4cbee21f40051e82c86
Contents?: true
Size: 1003 Bytes
Versions: 1
Compression:
Stored size: 1003 Bytes
Contents
RSpec.shared_examples "a group" do let(:resolver) { HungryForm::Resolver.new() } let(:page) { described_class.new(:parent_name, nil, resolver, {}) {} } let(:group_options) { {} } let(:group) { described_class.new(:name, page, resolver, group_options) {} } it_behaves_like "an element" describe "#group" do it "creates a nested group" do group.group(:nested, {}) {} expect(group.elements.first.class).to eq HungryForm::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 ".method_missing" do it "creates a nested element" do group.html(:name) expect(group.elements.first.class).to eq HungryForm::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" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hungryform-0.0.1 | spec/support/shared_group.rb |