This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class HostsControllerTest < ActionController::TestCase | |
context "Logged in as admin" do | |
setup do | |
@user = Factory.build(:admin_user) ## build, not create since it won't hit the database then | |
HostsController.any_instance.stubs(:current_user).returns(@user) | |
end | |
context "on INDEX action" do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Factory.define :admin_user, :class => "user" do |f| | |
f.email "[email protected]" | |
f.first_name "Daniel" | |
f.last_name "McNevin" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
include Esc::Authentication | |
before_filter :require_user | |
before_filter :set_user | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
establish_connection( | |
YAML.load_file("#{Rails.root}/config/sessions_database.yml")[Rails.env] | |
) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm install jruby | |
rvm use jruby | |
gem install redcar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rc() { | |
rvm jruby -S ~/.rvm/gems/jruby-1.5.1/bin/redcar $@ 1> /dev/null 2>&1 & | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionController::Base.session = { | |
:key => '_sso_session', | |
:secret => 'a really long hex string' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.action_controller.session = { | |
:domain => ".rails.local" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.config.session_store :cookie_store, { | |
:domain => '.rails.local', | |
:key => '_sso_session', | |
:secret => 'the same really long hex string' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.application.config.session_store :cookie_store, { | |
:domain => '.rails.local', | |
:key => '_sso_session' | |
} | |
Rails.application.config.secret_token = 'the same really long hex string' |
OlderNewer