Sha256: 8b69570f46819953f0fb084f65d39733ec89e9b6033e1fa18dd6e58160065ed6

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 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 controllers in feature' do
    login User.create!
    expect { visit('/chili/social_feature/likes') }.to raise_error(ActionController::RoutingError)
  end

  scenario 'when admin active_if makes controllers available' do
    login User.create!(admin: true)
    visit('/chili/social_feature/likes')
    page.should have_content('Your Likes')
  end
end

feature 'Multiple chili features' 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

4 entries across 4 versions & 1 rubygems

Version Path
chili-3.1.0 spec/features/social_extension_spec.rb
chili-3.0.0 spec/features/social_extension_spec.rb
chili-2.0.1 spec/requests/social_extension_spec.rb
chili-2.0.0 spec/requests/social_extension_spec.rb