Created
February 14, 2014 18:43
-
-
Save joncodo/9006580 to your computer and use it in GitHub Desktop.
Test_example.rb
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
| context 'When loading the page for the first time' do | |
| setup do | |
| @account = FactoryGirl.create(:account, id: 1234) | |
| @user = FactoryGirl.create(:confirmed_user, account: @account) | |
| sign_in @user | |
| contact = FactoryGirl.create(:contact, account: @account) | |
| @fortune_company= FactoryGirl.create(:fortune_company, account_name: 'the Company') | |
| FactoryGirl.create(:contact_history, contact: contact, company_name: @fortune_company.account_name) | |
| FactoryGirl.create(:contact_history, contact: contact, company_name: @fortune_company.account_name) | |
| FactoryGirl.create(:contact_history, contact: contact, company_name: @fortune_company.account_name) | |
| FactoryGirl.create(:contact_history, contact: contact, company_name: @fortune_company.account_name) | |
| get(:company_details, { company: 'Salesforce', fortune_company_id: @fortune_company.id }) | |
| end | |
| should 'populate the correct instance variables' do | |
| assert_not_nil assigns(:total_pages) | |
| assert_not_nil assigns(:recent_activities) | |
| assert_equal 1, assigns[:total_pages] | |
| assert_equal 4, assigns[:recent_activities].count | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment