# encoding: utf-8
require "spec_helper"

module Refinery
  module <%= namespacing %>
    describe "<%= plural_name %>", type: :feature do

      before(:each) do
        Refinery::<%= namespacing %>::Engine::load_seed
      end

      describe "Create <%= singular_name %>" do

        before do
          visit refinery.new_<%= plural_name %>_<%= singular_name %>_path
        end

        it "should create a new item" do
<% attributes.each do |a| -%><% if a.type == :string -%>
          fill_in "<%= singular_name %>_<%= a.name %>", :with => "Test"
<% elsif a.type == :text -%>
          fill_in "<%= singular_name %>_<%= a.name %>", :with => "Test"
<% end -%><% end -%>

          click_button ::I18n.t('.refinery.<%= plural_name %>.<%= plural_name %>.new.send')

          page.should have_content("Thank You")
          Refinery::<%= namespacing %>::<%= class_name %>.count.should == 1
        end
      end
    end
  end
end


# encoding: utf-8
require "spec_helper"

module Refinery
  module <%= namespacing %>
    describe "<%= plural_name %>", type: :feature do

      before(:each) do
        Refinery::<%= namespacing %>::Engine::load_seed
      end

      describe "Create <%= singular_name %>" do

        before do
          visit refinery.new_<%= plural_name %>_<%= singular_name %>_path
        end

        it "should create a new item" do
<% attributes.each do |a| -%><% if a.type == :string -%>
          fill_in "<%= singular_name %>_<%= a.name %>", :with => "Test"
<% elsif a.type == :text -%>
          fill_in "<%= singular_name %>_<%= a.name %>", :with => "Test"
<% end -%><% end -%>

          click_button ::I18n.t('.refinery.<%= plural_name %>.<%= plural_name %>.new.send')

          expect(page).to have_content("Thank You")
          expect(Refinery::<%= namespacing %>::<%= class_name %>.count).to eq(1)
        end
      end
    end
  end
end


Fix deprecated test assertion (should vs expect)
Fix deprecated test assertion (should vs expect)
