Sha256: 054abb4663e1e710b8de157167c10c450d27386d7e731c4f394b0f6864bbfb89

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

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')
    page.should_not have_content('Like functionality is in beta')
  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/social_extension/likes') }.to raise_error(ActionController::RoutingError)
  end

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

feature 'Multiple chili extensions' do
  scenario 'multiple overrides do not redefine each other' do
    User.create!(admin: true)
    visit('/posts')
    page.should have_content('Like functionality is in beta')
    page.should have_content('Invite functionality is also in beta')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chili-0.3.4 spec/requests/social_extension_spec.rb
chili-0.3.3 spec/requests/social_extension_spec.rb
chili-0.3.2 spec/requests/social_extension_spec.rb