diff --git a/Gemfile.lock b/Gemfile.lock index a76d2ef1..4008db00 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -103,9 +103,9 @@ GEM factory_girl_rails (4.5.0) factory_girl (~> 4.5.0) railties (>= 3.0.0) - fakeweb (1.3.0) faker (1.4.3) i18n (~> 0.5) + fakeweb (1.3.0) faraday (0.8.7) multipart-post (~> 1.1) fastercsv (1.5.5) @@ -273,8 +273,8 @@ DEPENDENCIES devise (~> 3.3.0) dotenv-rails factory_girl_rails - fakeweb faker + fakeweb friendly_id (~> 4.0.10) geocoder jquery-rails diff --git a/db/schema.rb b/db/schema.rb index 5dad3cdc..eb3d86ae 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -142,11 +142,11 @@ t.datetime "updated_at", :null => false t.string "image_url" t.string "twitter", :limit => 15 - t.string "slug" t.string "logo_file_name" t.string "logo_content_type" t.integer "logo_file_size" t.datetime "logo_updated_at" + t.string "slug" end add_index "organizations", ["slug"], :name => "index_organizations_on_slug", :unique => true diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 46dfb4b2..a640a887 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -1,9 +1,9 @@ -require 'spec_helper' +require "spec_helper" describe UsersController do describe "GET 'new'" do - it 'returns http success' do - get 'new' + it "returns http success" do + get "new" response.should be_success end end diff --git a/spec/factories.rb b/spec/factories.rb deleted file mode 100644 index 93cf1642..00000000 --- a/spec/factories.rb +++ /dev/null @@ -1,37 +0,0 @@ -FactoryGirl.define do - sequence :email do |n| - "#{Faker::Internet.user_name}#{n}@#{Faker::Internet.domain_name}" - end - - sequence :user_name do |n| - "#{Faker::Internet.user_name}#{n}" - end - - sequence :random_word do |n| - "#{Faker::Lorem.word}#{n}" - end - - factory :event do - short_code { generate(:random_word) } - name Faker::Lorem.word - end - - factory :organization do - name Faker::Company.name - end - - factory :job do - title Faker::Lorem.sentence(3) - end - - factory :project do - name { generate(:random_word) } - github_repo { generate(:random_word) } - end - - factory :user do - email { generate(:email) } - password Faker::Internet.password - end - -end \ No newline at end of file diff --git a/spec/factories/events.rb b/spec/factories/events.rb index 44f052a4..39f631dd 100644 --- a/spec/factories/events.rb +++ b/spec/factories/events.rb @@ -10,4 +10,28 @@ end_date { Time.new(2014, 10, 31) } end end + + factory :cm_event, class: Event do + short_code { Faker::Lorem.word } + name Faker::Lorem.word + + trait :end_tomorrow do + start_date Time.now + end_date Time.now + 1.day + end + + trait :future do + start_date Time.now + 1.day + end_date Time.now + 2.day + end + + trait :end_today do + start_date Time.now + end_date Time.now + end + + trait :public do + is_public true + end + end end diff --git a/spec/factories/job.rb b/spec/factories/job.rb new file mode 100644 index 00000000..af00ded5 --- /dev/null +++ b/spec/factories/job.rb @@ -0,0 +1,13 @@ +FactoryGirl.define do + factory :cm_job, class: Job do + title Faker::Lorem.sentence(1) + + trait :expire_tomorrow do + expires_at DateTime.now + 1.day + end + + trait :expired do + expires_at DateTime.now - 1.day + end + end +end diff --git a/spec/factories/organizations.rb b/spec/factories/organizations.rb index d0d6a98f..c00891a9 100644 --- a/spec/factories/organizations.rb +++ b/spec/factories/organizations.rb @@ -3,4 +3,8 @@ name "CodeMontage" github_org "CodeMontageHQ" end + + factory :cm_organization, class: Organization do + name Faker::Company.name + end end diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb index 694add8f..ee2b4ec1 100644 --- a/spec/factories/projects.rb +++ b/spec/factories/projects.rb @@ -4,4 +4,17 @@ name "CodeMontage" github_repo "codemontage" end + + factory :cm_project, class: Project do + name { Faker::Lorem.word } + github_repo { Faker::Lorem.word } + + trait :inactive do + is_active false + end + + trait :approved do + is_approved true + end + end end diff --git a/spec/factories/user.rb b/spec/factories/user.rb index 4c999141..2cb02e92 100644 --- a/spec/factories/user.rb +++ b/spec/factories/user.rb @@ -14,4 +14,9 @@ create_list(:service, 1, user: user) end end + + factory :cm_user, class: User do + email { "#{Faker::Internet.user_name}@#{Faker::Internet.domain_name}" } + password Faker::Internet.password + end end diff --git a/spec/features/pages_spec.rb b/spec/features/pages_spec.rb index 69faedc7..59cecead 100644 --- a/spec/features/pages_spec.rb +++ b/spec/features/pages_spec.rb @@ -1,35 +1,35 @@ -require 'spec_helper' +require "spec_helper" -describe 'The basic content site', #:js => true, +describe "The basic content site", #:js => true, type: :feature do - context 'pages' do - it 'displays landing page' do - visit '/' - page.should have_content('Ready to change the world?') + context "pages" do + it "displays landing page" do + visit "/" + page.should have_content("Ready to change the world?") end - it 'displays projects page' do - visit '/projects' - page.should have_content('Projects') + it "displays projects page" do + visit "/projects" + page.should have_content("Projects") end - it 'displays jobs page' do - visit '/jobs' + it "displays jobs page" do + visit "/jobs" page.should have_content("Jobs You've Been Looking For") end - it 'displays coder day page' do - visit '/coder_day' - page.should have_content('Coder Day of Service') + it "displays coder day page" do + visit "/coder_day" + page.should have_content("Coder Day of Service") end - it 'displays our story page' do - visit '/our_story' - page.should have_content('Major Contributors') + it "displays our story page" do + visit "/our_story" + page.should have_content("Major Contributors") end - it 'displays resources page' do - visit '/resources' + it "displays resources page" do + visit "/resources" page.should have_content("We're not the only ones") end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index bb3c4699..eec58748 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -1,17 +1,18 @@ -require 'spec_helper' +require "spec_helper" describe ApplicationHelper do - describe '#display_url' do - it 'returns the domain portion of a given url' do - expect(helper.display_url('http://www.foo.com/bar/12')).to eq('www.foo.com/bar/12') + describe "#display_url" do + it "returns the domain portion of a given url" do + expect(helper.display_url("http://www.foo.com/bar/12")). + to eq("www.foo.com/bar/12") end end - context 'logo retrieval' do + context "logo retrieval" do let(:organization) { Organization.new } let(:logo) { double } - describe '#find_logo' do + describe "#find_logo" do it "returns an organization's attached logo if it exists" do organization.stub(:logo) { logo } logo.should_receive(:url).with(:medium) @@ -20,25 +21,25 @@ it "returns an organizations's image_url if no attached logo exists" do organization.stub(:logo) { nil } - organization.stub(:image_url) { 'foo.png' } - expect(helper.find_logo(organization)).to eq('foo.png') + organization.stub(:image_url) { "foo.png" } + expect(helper.find_logo(organization)).to eq("foo.png") end end - describe '#find_logo?' do - it 'returns true if an organization has a logo attachment' do - organization.stub(:logo) { 'something' } + describe "#find_logo?" do + it "returns true if an organization has a logo attachment" do + organization.stub(:logo) { "something" } organization.stub(:image_url) { nil } expect(helper.find_logo?(organization)).to be_true end - it 'returns true if an organization has an image_url defined' do + it "returns true if an organization has an image_url defined" do organization.stub(:logo) { nil } - organization.stub(:image_url) { 'foo.png' } + organization.stub(:image_url) { "foo.png" } expect(helper.find_logo?(organization)).to be_true end - it 'returns false if neither logo nor image_url are present' do + it "returns false if neither logo nor image_url are present" do organization.stub(:logo) { nil } organization.stub(:image_url) { nil } expect(helper.find_logo?(organization)).to be_false @@ -46,12 +47,13 @@ end end - describe '#twitter_url' do - it 'returns twitter url for given non nil handle' do - helper.twitter_url('CodeMontage').should eq('http://twitter.com/CodeMontage') + describe "#twitter_url" do + it "returns twitter url for given non nil handle" do + helper.twitter_url("CodeMontage"). + should eq("http://twitter.com/CodeMontage") end - it 'returns nil when nil is given' do + it "returns nil when nil is given" do helper.twitter_url(nil).should eq(nil) end end diff --git a/spec/helpers/project_controller_helper_spec.rb b/spec/helpers/project_controller_helper_spec.rb index 9222ee14..be1ff170 100644 --- a/spec/helpers/project_controller_helper_spec.rb +++ b/spec/helpers/project_controller_helper_spec.rb @@ -1,59 +1,65 @@ -require 'spec_helper' +require "spec_helper" describe ProjectControllerHelper do - describe '#code_later_url' do + describe "#code_later_url" do let(:url) { helper.code_later_url } before do - Date.stub(:tomorrow) { Date.parse('1971/12/17') } + Date.stub(:tomorrow) { Date.parse("1971/12/17") } end - it 'returns a url with a start date parameter of tomorrow at 2pm' do + it "returns a url with a start date parameter of tomorrow at 2pm" do url = helper.code_later_url - expected = '19711217T140000Z' + expected = "19711217T140000Z" expect(url.include?(expected)).to be_true end - it 'returns a url with an end date parameter of tomorrow at 6pm' do + it "returns a url with an end date parameter of tomorrow at 6pm" do url = helper.code_later_url - expected = '19711217T180000Z' + expected = "19711217T180000Z" expect(url.include?(expected)).to be_true end end - describe '#project_tags_link_list' do + describe "#project_tags_link_list" do let(:project) do Project.new( organization_id: 1, - name: 'CodeMontage Platform', - github_repo: 'codemontage' + name: "CodeMontage Platform", + github_repo: "codemontage" ) end before do - project.stub(:causes) { [double('Tag', name: 'Cause1'), double('Tag', name: 'Cause2')] } - project.stub(:technologies) { [double('Tag', name: 'Ruby'), double('Tag', name: 'Rails')] } + project.stub(:causes) do + [double("Tag", name: "Cause1"), double("Tag", name: "Cause2")] + end + project.stub(:technologies) do + [double("Tag", name: "Ruby"), double("Tag", name: "Rails")] + end end - context 'given a technologies argument' do - let(:links_list) { helper.project_tags_link_list(project, 'technologies') } + context "given a technologies argument" do + let(:links_list) do + helper.project_tags_link_list(project, "technologies") + end - it 'returns a list of technology links' do - expect(links_list).to include('Ruby') - expect(links_list).to include('Rails') - expect(links_list).to include(projects_path(tags: 'Ruby')) - expect(links_list).to include(projects_path(tags: 'Rails')) + it "returns a list of technology links" do + expect(links_list).to include("Ruby") + expect(links_list).to include("Rails") + expect(links_list).to include(projects_path(tags: "Ruby")) + expect(links_list).to include(projects_path(tags: "Rails")) end end - context 'given a causes argument' do - let(:links_list) { helper.project_tags_link_list(project, 'causes') } + context "given a causes argument" do + let(:links_list) { helper.project_tags_link_list(project, "causes") } - it 'returns a list of cause links' do - expect(links_list).to include('Cause1') - expect(links_list).to include('Cause2') - expect(links_list).to include(projects_path(tags: 'Cause1')) - expect(links_list).to include(projects_path(tags: 'Cause2')) + it "returns a list of cause links" do + expect(links_list).to include("Cause1") + expect(links_list).to include("Cause2") + expect(links_list).to include(projects_path(tags: "Cause1")) + expect(links_list).to include(projects_path(tags: "Cause2")) end end end diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 5cd347a6..7174f945 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -9,24 +9,20 @@ it { should have_many(:users).through(:event_registrations) } before(:each) do - @event1 = create(:event, start_date: Time.now, end_date: Time.now+1.day) - @event2 = create(:event, start_date: Time.now, end_date: Time.now) - @event3 = create(:event, start_date: Time.now+1.day, end_date: Time.now+2.day) + @event1 = create(:cm_event, :end_tomorrow, :public) + @event2 = create(:cm_event, :end_today) + @event3 = create(:cm_event, :future) end describe "upcoming event scope" do - it "should return only upcoming events" do expect(Event.upcoming_events).to eq([@event1, @event3]) end - end describe "featured events" do - it "should return only one upcoming event sorted by starting date" do expect(Event.featured).to eq(@event1) end - end end diff --git a/spec/models/favorite_project_spec.rb b/spec/models/favorite_project_spec.rb index dfa3f696..e4cb7c8a 100644 --- a/spec/models/favorite_project_spec.rb +++ b/spec/models/favorite_project_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe FavoriteProject do it { should belong_to(:project) } diff --git a/spec/models/job_spec.rb b/spec/models/job_spec.rb index 69a42259..4d6d8a56 100644 --- a/spec/models/job_spec.rb +++ b/spec/models/job_spec.rb @@ -1,21 +1,18 @@ -require 'spec_helper' +require "spec_helper" describe Job do it { should belong_to(:organization) } before(:each) do @organization = create(:organization) - @job1 = create(:job, :organization_id => @organization.id, :expires_at => DateTime.now+1.day) - @job2 = create(:job, :organization_id => @organization.id, :expires_at => DateTime.now-1.day) - @job3 = create(:job, :organization_id => @organization.id) + @job1 = create(:cm_job, :expire_tomorrow, organization_id: @organization.id) + @job2 = create(:cm_job, :expired, organization_id: @organization.id) + @job3 = create(:cm_job, organization_id: @organization.id) end describe "active scope" do - - it "should return jobs which not expires or does not have expires_at field" do + it "should return jobs which not expires or not had expires_at field" do expect(Job.active).to eq([@job1, @job3]) end - end - end diff --git a/spec/models/organization_metric_spec.rb b/spec/models/organization_metric_spec.rb index a7bf7304..19a67c11 100644 --- a/spec/models/organization_metric_spec.rb +++ b/spec/models/organization_metric_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe OrganizationMetric do it { should belong_to(:organization) } diff --git a/spec/models/organization_spec.rb b/spec/models/organization_spec.rb index 5041fb7a..f095ed5b 100644 --- a/spec/models/organization_spec.rb +++ b/spec/models/organization_spec.rb @@ -1,40 +1,36 @@ -require 'spec_helper' +require "spec_helper" describe Organization do - it { should have_many(:organization_metrics) } it { should have_many(:projects) } it { should have_many(:jobs) } - it { should have_many(:sponsorships)} + it { should have_many(:sponsorships) } it { should validate_presence_of(:name) } context "validations" do - - context 'if public submission' do - before { subject.stub(:is_public_submission){true} } + context "if public submission" do + before { subject.stub(:is_public_submission) { true } } it { should validate_presence_of(:github_org) } end - context 'if not public submission' do - before { subject.stub(:is_public_submission){false} } + context "if not public submission" do + before { subject.stub(:is_public_submission) { false } } it { should_not validate_presence_of(:github_org) } end - context 'if not public submission, implicit' do + context "if not public submission, implicit" do it { should_not validate_presence_of(:github_org) } end - end context "scopes" do - before(:each) do - @organization1 = create(:organization, :name => "Spritle") - @organization2 = create(:organization, :name => "Foo") - @project1 = create(:project, :organization_id => @organization1.id) - @project2 = create(:project, :organization_id => @organization1.id, :is_active => false) - @project3 = create(:project, :organization_id => @organization1.id, :is_approved => true) - @job = create(:job, :organization_id => @organization1.id) + @organization1 = create(:cm_organization, name: "Spritle") + @organization2 = create(:cm_organization, name: "Foo") + @project1 = create(:cm_project, organization_id: @organization1.id) + @project2 = create(:cm_project, :inactive, organization_id: @organization1.id) + @project3 = create(:cm_project, :approved, organization_id: @organization1.id) + @job = create(:cm_job, organization_id: @organization1.id) end describe "approved scope" do @@ -44,7 +40,7 @@ end describe "featured scope" do - it "should return all organization which has approved & active projects" do + it "should return organizations which has approved & active projects" do expect(Organization.featured).to eq([@organization1]) end end @@ -54,67 +50,60 @@ expect(Organization.hiring).to eq([@organization1]) end end - end - context "url wrangling" do - - let(:organization) { Organization.new(url: 'http://www.amazing.org', github_org: 'amazing')} + let(:organization) do + Organization.new(url: "http://www.amazing.org", github_org: "amazing") + end describe "#display_url" do - it "returns the hostname of its url" do - expect(organization.display_url).to eq('www.amazing.org') + expect(organization.display_url).to eq("www.amazing.org") end it "returns an empty string if its url is missing" do organization.stub(url: nil) - expect(organization.display_url).to eq('') + expect(organization.display_url).to eq("") end - end describe "#github_url" do - it "concatentates its github url" do - expect(organization.github_url).to eq('https://github.com/amazing') + expect(organization.github_url).to eq("https://github.com/amazing") end it "returns an empty string if it has no github org" do organization.stub(github_org: nil) expect(organization.github_url).to be_nil end - end - end context "logo deletion" do - let(:organization) { Organization.new } let(:logo) { double } - + before do organization.stub(:logo) { logo } end describe "#logo_delete" do it "defaults its logo_delete flag" do - expect(organization.logo_delete).to eq('0') + expect(organization.logo_delete).to eq("0") end - end + end describe "#logo_delete=" do it "sets its logo_delete flag" do - organization.logo_delete = 'foo' - expect(organization.logo_delete).to eq('foo') + organization.logo_delete = "foo" + expect(organization.logo_delete).to eq("foo") end - end + end describe "#delete_logo" do it "clears its logo if its logo_delete flag is set to 1" do - organization.stub(:logo_delete) { '1' } + organization.stub(:logo_delete) { "1" } logo.should_receive(:clear) organization.send(:delete_logo) end @@ -124,7 +113,5 @@ organization.send(:delete_logo) end end - end - end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 7804794c..90c3299e 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -11,10 +11,10 @@ context "scopes" do before(:each) do - @organization = create(:organization) - @project1 = create(:project, :organization_id => @organization.id) - @project2 = create(:project, :organization_id => @organization.id, :is_active => false) - @project3 = create(:project, :organization_id => @organization.id, :is_approved => true) + @organization = create(:cm_organization) + @project1 = create(:cm_project, organization_id: @organization.id) + @project2 = create(:cm_project, :inactive, organization_id: @organization.id) + @project3 = create(:cm_project, :approved, organization_id: @organization.id) end describe "approved scope" do @@ -24,7 +24,7 @@ end describe "active scope" do - it "should return only approved & active project" do + it "should return only approved & active project" do expect(Project.active).to eq([@project3]) end end @@ -34,37 +34,36 @@ expect(Project.featured).to eq([@project3]) end end - end context "github-related methods" do - let(:project) { Project.new } - let(:organization) { double(github_org: 'codemontage', github_url: 'https://github.com/codemontage') } + let(:organization) do + double(github_org: "codemontage", github_url: "https://github.com/codemontage") + end before do project.stub(:organization) { organization } - project.stub(:github_repo) { 'foo'} + project.stub(:github_repo) { "foo" } end describe "#github_display" do it "creates an organization/repo string" do - expect(project.github_display).to eq('codemontage/foo') + expect(project.github_display).to eq("codemontage/foo") end end describe "#github_url" do it "creates a repo url" do - expect(project.github_url).to eq('https://github.com/codemontage/foo') + expect(project.github_url).to eq("https://github.com/codemontage/foo") end end describe "#tasks_url" do it "creates an issues url" do - expect(project.tasks_url).to eq('https://github.com/codemontage/foo/issues') + expect(project.tasks_url).to eq("https://github.com/codemontage/foo/issues") end end - end describe "GitHub API interaction" do @@ -114,18 +113,15 @@ end describe "#related_projects" do - - let(:organization) { Organization.create!(name: 'CodeMontage') } + let(:organization) { create(:cm_organization) } before do - @project_1 = Project.create!(name: 'Code Montage', organization_id: organization.id, github_repo: 'codemontage') - @project_2 = Project.create!(name: 'Happy Days', organization_id: organization.id, github_repo: 'happydays') + @project_1 = create(:cm_project, organization_id: organization.id) + @project_2 = create(:cm_project, organization_id: organization.id) end it "returns its organization's other projects" do expect(@project_1.related_projects).to eq([@project_2]) end - end - end diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index cc971279..ec4eb063 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe Service do it { should belong_to(:user) } diff --git a/spec/models/sponsorship_spec.rb b/spec/models/sponsorship_spec.rb index 670b051b..94a2f5f6 100644 --- a/spec/models/sponsorship_spec.rb +++ b/spec/models/sponsorship_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe Sponsorship do it { should belong_to(:organization) } diff --git a/spec/models/tag_spec.rb b/spec/models/tag_spec.rb index 76099b9b..180275cc 100644 --- a/spec/models/tag_spec.rb +++ b/spec/models/tag_spec.rb @@ -1,5 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe Tag do - end diff --git a/spec/models/user_profile_spec.rb b/spec/models/user_profile_spec.rb index 19f78b8a..c85522b1 100644 --- a/spec/models/user_profile_spec.rb +++ b/spec/models/user_profile_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe UserProfile do it { should belong_to(:user) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 1ae6bcfa..969e3a00 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,4 +1,4 @@ -require 'spec_helper' +require "spec_helper" describe User do # rspec shoulda matchers @@ -15,21 +15,19 @@ it { should have_one(:profile) } before do - @user = User.new(email: 'captain@planet.com', password: 'passw0rd') + @user = User.new(email: "captain@planet.com", password: "passw0rd") end describe "with_github" do - before do - @user1 = create(:user) - @user2 = create(:user) - @service = @user1.services.create(provider: 'github', uid: 'foobar') + @user1 = create(:cm_user) + @user2 = create(:cm_user) + @service = @user1.services.create(provider: "github", uid: "foobar") end it "should return user who has github service" do expect(User.with_github).to eq([@user1]) end - end subject { @user } @@ -37,14 +35,14 @@ it { should respond_to(:email) } it { should be_valid } - describe 'email not present' do - before { @user.email = ' ' } + describe "email not present" do + before { @user.email = " " } it { should_not be_valid } end - describe 'duplicate email' do + describe "duplicate email" do before do - @user2 = User.new(email: 'captain@planet.com', password: 'passw0rd') + @user2 = User.new(email: "captain@planet.com", password: "passw0rd") @user2.save end it { should_not be_valid } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 91225da6..88816499 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,7 +1,7 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' +ENV["RAILS_ENV"] ||= "test" -require 'simplecov' +require "simplecov" SimpleCov.start do add_filter "/config/" add_filter "/spec/" @@ -14,15 +14,15 @@ require File.expand_path("../../config/environment", __FILE__) -require 'rspec/rails' -require 'rspec/autorun' -require 'capybara/rspec' -require 'vcr' -require 'factory_girl' +require "rspec/rails" +require "rspec/autorun" +require "capybara/rspec" +require "vcr" +require "factory_girl" # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. -Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} +Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } VCR.configure do |c| c.cassette_library_dir = "spec/cassettes" @@ -61,5 +61,4 @@ # the seed, which is printed after each run. # --seed 1234 config.order = "random" - config.include FactoryGirl::Syntax::Methods end