Sha256: de7689427386d55a03d2054ebbf6d0e9b50bd00f9272c036032adbe7e2b79e11

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe 'Shared index' do
  subject { page }

  let(:user) { get_user }

  before do
    Adminpanel::User.delete_all
    visit adminpanel.signin_path
    valid_signin_as_admin(user)
  end

  after do
    Adminpanel::User.delete_all
  end

  context 'mugs#index excluding every rest action with configurtions but index' do
    before do
      Adminpanel::Mug.create
      visit adminpanel.mugs_path
    end

    after do
      Adminpanel::Mug.delete_all
    end

    it 'should not have create mug button' do
      should_not have_link('a', href:'/adminpanel/tazas/new')
    end
    it 'should not have show or destroy button' do
      should_not have_link('a', href:'/adminpanel/tazas/1')
    end
    it 'should not have edit button' do
      should_not have_link('a', href:'/adminpanel/tazas/1/edit')
    end
  end


  context 'index' do
    let!(:product) { FactoryGirl.create(:product) }
    before do
      visit adminpanel.products_path
    end

    it { should have_link(Adminpanel::Product.display_name, adminpanel.new_product_path)}
    it { should have_link('i', adminpanel.product_path(product)) }
    it { should have_link('i', adminpanel.edit_product_path(product)) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adminpanel-2.1.1 spec/features/shared_pages/index_spec.rb
adminpanel-2.1.0 spec/features/shared_pages/index_spec.rb