spec/elements/page_spec.rb in hungryform-0.0.4 vs spec/elements/page_spec.rb in hungryform-0.0.6

- old
+ new

@@ -1,25 +1,28 @@ require "spec_helper" describe HungryForm::Elements::Page do - let(:resolver) { HungryForm::Resolver.new() } + let(:resolver_options) { {} } + let(:resolver) { HungryForm::Resolver.new(resolver_options) } + let(:options) { {} } - let(:page) { HungryForm::Elements::Page.new(:pagename, nil, resolver, options) {} } + subject { HungryForm::Elements::Page.new(:element_name, nil, resolver, options) {} } - it_behaves_like "a group" + it_behaves_like 'an element' + it_behaves_like 'a group' describe ".new" do it "should have one element" do - page = HungryForm::Elements::Page.new(:pagename, nil, resolver, options) do + subject = HungryForm::Elements::Page.new(:element_name, nil, resolver, options) do html :html_name, value: "<p>Test html block</p>" end - expect(page.elements.size).to eq 1 + expect(subject.elements.size).to eq 1 end end describe "#group" do it "should contain a group" do - page.group(:group_name, {}) {} - expect(page.elements.first.class).to eq HungryForm::Elements::Group + subject.group(:group_name, {}) {} + expect(subject.elements.first.class).to eq HungryForm::Elements::Group end end end \ No newline at end of file