Sha256: 3a8b515202444522b6236ef62c78658d63aeb68c55e96fa01e68a8bc625c12b6

Contents?: true

Size: 696 Bytes

Versions: 12

Compression:

Stored size: 696 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::PagesController do
  render_views
  
  before do
    set_lang :en
    # create page with slug=english-title-1
    @page = Factory(:page)
  end
  
  after do
    Kuhsaft::Page.all.each { |p| p.destroy }
    reset_lang
  end
  
  describe 'should render successfully' do
    it '#show' do
      get :show, :locale => 'en', :url => 'english-title-1'
      response.response_code.should eq(200)
      response.should be_success
    end
  end
  
  describe 'should render 404' do
    it 'should raise RoutingError by default' do
      expect{ get :show, :locale => 'en', :url => '/i-dont-know' }.to raise_error(ActionController::RoutingError)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
kuhsaft-0.3.4.legacy3 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.4.legacy2 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.4.legacy spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.6 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.5 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.4 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.4.rc2 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.4.rc1 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.3 spec/controllers/pages_controller_spec.rb
kuhsaft-0.3.2 spec/controllers/pages_controller_spec.rb
kuhsaft-0.2.5 spec/controllers/pages_controller_spec.rb
kuhsaft-0.2.4 spec/controllers/pages_controller_spec.rb