Sha256: 0de7141b2f7869f8ec0e4f13c74e886ef71d65766b47d8bb44ec46de54cacc9d

Contents?: true

Size: 649 Bytes

Versions: 6

Compression:

Stored size: 649 Bytes

Contents

require 'spec_helper'

class FlashesController < ActionController::Base
  include Clearance::Controller

  def set_flash
    flash[:notice] = params[:message]
    redirect_to view_flash_url
  end

  def view_flash
    render text: "<html><body>#{flash[:notice]}</body></html>"
  end
end

describe FlashesController do
  before do
    Rails.application.routes.draw do
      get '/set_flash' => 'flashes#set_flash'
      get '/view_flash' => 'flashes#view_flash'
    end
  end

  after do
    Rails.application.reload_routes!
  end

  it 'sets and views a flash' do
    visit '/set_flash?message=hello'
    page.should have_content('hello')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
clearance-1.4.3 spec/controllers/flashes_controller_spec.rb
clearance-1.4.2 spec/controllers/flashes_controller_spec.rb
clearance-1.4.1 spec/controllers/flashes_controller_spec.rb
clearance-1.4.0 spec/controllers/flashes_controller_spec.rb
clearance-1.3.0 spec/controllers/flashes_controller_spec.rb
clearance-1.2.1 spec/controllers/flashes_controller_spec.rb