Sha256: 9e2d55ec003785788a7a10effa8c0c8bcf6b54d7743ac3795f9195187010d8a6

Contents?: true

Size: 778 Bytes

Versions: 2

Compression:

Stored size: 778 Bytes

Contents

require 'spec_helper'

feature 'View overrides' do
  scenario 'when user is not admin active_if toggles overrides off' do
    User.create!
    visit('/posts')
    page.should_not have_content('See Your Likes')
  end

  scenario 'when admin active_if toggles overrides on' do
    User.create!(admin: true)
    visit('/posts')
    page.should have_content('See Your Likes')
  end
end

feature 'Togglable controllers' do
  scenario 'when user is not admin active_if hides engine controller' do
    User.create!
    expect { visit('/chili_likes/likes') }.to raise_error(ActionController::RoutingError)
  end

  scenario 'when admin active_if toggles overrides on' do
    User.create!(admin: true)
    visit('/chili_likes/likes')
    page.should have_content('Your Likes')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chili-0.0.6 spec/requests/chili_likes_spec.rb
chili-0.0.5 spec/requests/chili_likes_spec.rb