Sha256: 7f53f0c0a6366f0330bf242d62e0ae226c57ac74cb595fb972c676504c0a1b94

Contents?: true

Size: 1.18 KB

Versions: 3

Compression:

Stored size: 1.18 KB

Contents

require 'spec_helper'

feature 'View overrides' do
  scenario 'when user is not admin active_if toggles overrides off' do
    login 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
    login 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 extension controller' do
    login User.create!
    expect { visit('/chili/social_extension/likes') }.to raise_error(ActionController::RoutingError)
  end

  scenario 'when admin active_if makes extension controller available' do
    login 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
    login 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-1.0.1 spec/requests/social_extension_spec.rb
chili-1.0.0 spec/requests/social_extension_spec.rb
chili-0.3.5 spec/requests/social_extension_spec.rb