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
| source 'http://rubygems.org' | |
| #gem 'bundler', '1.0.0.rc.6' | |
| # System | |
| gem 'rails', '3.0.0' | |
| gem 'sqlite3-ruby' | |
| # View |
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
| describe '#destroy' do | |
| before :each do | |
| stub(HealthProfessional).find(8) { @health_professional } | |
| end | |
| context 'as a user without permissions' do | |
| before :each do | |
| login_as_user! |
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
| def destroy | |
| authorize! :destroy, @health_professional | |
| @health_professional.destroy | |
| respond_with @health_professional, :location => [ :manage, :health_professionals ] | |
| 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
| def self.premium_hotels | |
| where(:premium => true) | |
| end | |
| #is the same as | |
| scope :premium_hotels, where(:premium => true) |
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 Foo | |
| def self.pat_test(subject, pattern) | |
| notfound = -1 | |
| iSub = 0 | |
| rtnIndex = notfound | |
| isPat = false; | |
| subjectLen = subject.length; | |
| patternLen = pattern.length; |
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 'blah' | |
| describe Foo do | |
| describe "pat_test" do | |
| context "pattern is > subject" do | |
| it 'should return [-1,0]' do |
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 'blah' | |
| describe Foo do | |
| describe "pat_test" do | |
| context "pattern is > subject" do | |
| it 'should return [-1,0]' do |
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
| describe '#download_invoice' do | |
| let(:user) { Factory.create(:user) } | |
| context 'as a user with a valid token' do | |
| before :each do | |
| stub.proxy(User).where(anything) | |
| stub(User).where(:api_token => 'token') { [ user ] } |
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
| #user Model | |
| class User < ActiveRecord::Base | |
| PASSWORD_SALT = 'BC25635383433FDF2F5CF11AE8AA7380' | |
| extend LegacyTable | |
| legacy_table_name "tblUsers" |
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 :van_driver do |f| | |
| f.after_build do |ff| | |
| ff.van = Factory.build(:van) | |
| end | |
| f.after_create do |ff| | |
| ff.van.save! | |
| end | |
| f.association :user | |
| end |