Sha256: 72ada30d64114fafaa0aa40517273ede2ae85da5bb4a8358a7456d897725cf34

Contents?: true

Size: 1.3 KB

Versions: 10

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

describe Museum::CasesController do
  routes { Museum::Engine.routes }
  include_context 'loupe support'
  include_context 'case support'

  describe 'Routing' do
    it { should route(:get, '/').to(:action => 'index') }
    it { should route(:get, '/cases/bootswitch').to(:action => 'show', :id => 'bootswitch') }
    it { should route(:get, '/cases/bootswitch/refresh').to(:action => 'refresh', :id => 'bootswitch') }
  end

  describe 'GET index' do
    before(:each) { get :index }
    it { should respond_with(:success) }
    it { should render_template(:index) }
  end
  describe 'GET show' do
    context 'with an invalid gem name' do
      before(:each) { get :show, { id: 'bad' } }
      it { should respond_with(:not_found) }
    end
    context 'with a valid gem name' do
      before(:each) { get :show, { id: 'bootswitch' } }
      it { should respond_with(:success) }
      it { should render_template(:show) }
    end
  end
  describe 'GET refresh' do
    context 'with an invalid gem name' do
      before(:each) { get :refresh, { id: 'bad' } }
      it { should respond_with(:not_found) }
    end
    context 'with a valid gem name' do
      before(:each) { get :refresh, { id: 'bootswitch' } }
      it { should respond_with(:redirect) }
      it { should set_the_flash }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
museum-0.1.5 spec/controllers/cases_controller_spec.rb
museum-0.1.4 spec/controllers/cases_controller_spec.rb
museum-0.1.3 spec/controllers/cases_controller_spec.rb
museum-0.1.2 spec/controllers/cases_controller_spec.rb
museum-0.1.1 spec/controllers/cases_controller_spec.rb
museum-0.1.0 spec/controllers/cases_controller_spec.rb
museum-0.0.4 spec/controllers/cases_controller_spec.rb
museum-0.0.3 spec/controllers/cases_controller_spec.rb
museum-0.0.2 spec/controllers/cases_controller_spec.rb
museum-0.0.1 spec/controllers/cases_controller_spec.rb