Sha256: 8092927982a5e7e6d5658dda493e817ed8cc4dc34feb76677913467c6d0170fe

Contents?: true

Size: 658 Bytes

Versions: 6

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

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

  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
      match "set_flash" => "flashes#set_flash"
      match "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-0.16.3 spec/controllers/flashes_controller_spec.rb
clearance-0.16.2 spec/controllers/flashes_controller_spec.rb
clearance-0.16.1 spec/controllers/flashes_controller_spec.rb
clearance-0.16.0 spec/controllers/flashes_controller_spec.rb
clearance-0.15.0 spec/controllers/flashes_controller_spec.rb
clearance-0.14.0 spec/controllers/flashes_controller_spec.rb