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
| # spec/support/macros/authentication_macros.rb | |
| module AuthenticationMacros | |
| def sign_in_user | |
| let(:current_user) { Factory.stub(:user) } | |
| before do | |
| sign_in current_user | |
| warden.stub(:authenticate => current_user) | |
| warden.stub(:authenticate! => current_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
| module RandomHelpers | |
| def random_number() SecureRandom.random_number(10000); end | |
| def random_id() random_number; end | |
| def random_name() SecureRandom.hex(20); end | |
| end | |
| module ControllerHelpers | |
| def user_double(attrs = {}) | |
| user_attrs = { | |
| :first_name => random_name, |
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
| Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths| | |
| load_paths << "#{Rails.root}/app/assets/stylesheets" | |
| load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets" | |
| load_paths << "#{Gem.loaded_specs['html5-boilerplate'].full_gem_path}/stylesheets" | |
| load_paths << "#{Gem.loaded_specs['fancy-buttons'].full_gem_path}/lib/stylesheets" | |
| 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
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
NewerOlder