require File.expand_path('../../../../../easyproject/easy_plugins/easy_extensions/test/spec/spec_helper', __FILE__)

describe EasyChecklistsController, :logged => :admin do

  render_views

  it 'create template' do
    post :create, :entity_type => 'EasyChecklistTemplate',
      :easy_checklist => { :name => 'checklist', :project_ids => [],
      :is_default_for_new_projects => '1',
      :easy_checklist_items_attributes => {:'0' => {:subject => 'item', :_destroy => 'false', :done => 'false'}},
      }

      expect(assigns(:easy_checklist).valid?).to eq(true)
      expect(EasyChecklistTemplate.count).to eq(1)
      expect(EasyChecklistItem.count).to eq(1)
  end
end