This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 "daniel.mcnevin@something.com" | |
| f.first_name "Daniel" | |
| f.last_name "McNevin" | |
| end |
This file contains hidden or 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 |
NewerOlder