Skip to content

Instantly share code, notes, and snippets.

@nigelr
Created January 15, 2013 06:23
Show Gist options
  • Save nigelr/4536638 to your computer and use it in GitHub Desktop.
Save nigelr/4536638 to your computer and use it in GitHub Desktop.
application_controller_spec
require "spec_helper"
describe ApplicationController do
controller do
def index
render nothing: true
end
end
let(:user) { create(:user_agent) }
describe ".current_agent" do
before do
sign_in user
get :index
end
it('has method that returns current_agent') { expect(controller.current_agent).to eq(user.agent) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment