diff --git a/.travis.yml b/.travis.yml index e15eeb1a3..73c13baf4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,12 @@ -bundler_args: "--without development" +bundler_args: "--without development production" rvm: - ree # - 1.9.2 -script: "cp config/database.yml.example config/database.yml; bundle exec rake db:create; bundle exec rake cruise" +before_script: + - "sass --update public/stylesheets/sass/:public/stylesheets/" + - "cp config/database.yml.example config/database.yml" + - "rspec spec --tag fixture" + +script: "bundle exec rake travis" env: "TRAVIS=true" diff --git a/Gemfile b/Gemfile index 00b4b0fd7..029e6610e 100644 --- a/Gemfile +++ b/Gemfile @@ -81,10 +81,12 @@ end group :test, :development do gem 'factory_girl_rails', :require => false - gem 'ruby-debug-base19', '0.11.23' if RUBY_VERSION.include? '1.9.1' - gem 'ruby-debug19', :platforms => :ruby_19 - gem 'ruby-debug', :platforms => :mri_18 - gem 'linecache', '0.43', :platforms => :mri_18 + unless ENV["TRAVIS"] + gem 'ruby-debug-base19', '0.11.23' if RUBY_VERSION.include? '1.9.1' + gem 'ruby-debug19', :platforms => :ruby_19 + gem 'ruby-debug', :platforms => :mri_18 + gem 'linecache', '0.43', :platforms => :mri_18 + end gem 'launchy' gem 'jasmine', '1.0.2.1' end diff --git a/lib/tasks/cruise.rake b/lib/tasks/cruise.rake index 9888385f4..e49592d99 100644 --- a/lib/tasks/cruise.rake +++ b/lib/tasks/cruise.rake @@ -1,6 +1,22 @@ namespace :cruise do desc "Run all specs and features" task :cruise => [:environment, :'cruise:migrate'] do + run_cruise + end + + task :migrate do + system('bundle exec rake db:migrate') + exit_status = $?.exitstatus + raise "db:migrate failed!" unless exit_status == 0 + end + + task :travis => ['db:create', 'db:schema:load'] do + debugger + Jammit.package! + debugger + run_cruise + end + def run_cruise puts "Starting virtual display..." `sh -e /etc/init.d/xvfb start` puts "Starting specs..." @@ -14,11 +30,6 @@ namespace :cruise do raise "tests failed!" unless exit_status == 0 puts "All tests passed!" end - - task :migrate do - system('bundle exec rake db:migrate') - exit_status = $?.exitstatus - raise "db:migrate failed!" unless exit_status == 0 - end end task :cruise => "cruise:cruise" +task :travis => "cruise:travis" diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 3b1d684fa..029c7ff08 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -46,24 +46,24 @@ describe AspectsController do end describe "#index" do - it "generates a jasmine fixture", :fixture => 'jasmine' do + it "generates a jasmine fixture", :fixture => true do get :index save_fixture(html_for("body"), "aspects_index") end - it "generates a jasmine fixture with a prefill", :fixture => 'jasmine' do + it "generates a jasmine fixture with a prefill", :fixture => true do get :index, :prefill => "reshare things" save_fixture(html_for("body"), "aspects_index_prefill") end - it 'generates a jasmine fixture with services', :fixture => 'jasmine' do + it 'generates a jasmine fixture with services', :fixture => true do alice.services << Services::Facebook.create(:user_id => alice.id) alice.services << Services::Twitter.create(:user_id => alice.id) get :index, :prefill => "reshare things" save_fixture(html_for("body"), "aspects_index_services") end - it 'generates a jasmine fixture with posts', :fixture => 'jasmine' do + it 'generates a jasmine fixture with posts', :fixture => true do message = alice.post(:status_message, :text => "hello "*800, :to => @alices_aspect_2.id) 4.times { bob.comment("what", :post => message) } get :index diff --git a/spec/controllers/contacts_controller_spec.rb b/spec/controllers/contacts_controller_spec.rb index c730461ee..5720a6fe2 100644 --- a/spec/controllers/contacts_controller_spec.rb +++ b/spec/controllers/contacts_controller_spec.rb @@ -62,7 +62,7 @@ describe ContactsController do contacts.to_set.should == bob.contacts.to_set end - it "generates a jasmine fixture", :fixture => 'jasmine' do + it "generates a jasmine fixture", :fixture => true do get :index save_fixture(html_for("body"), "aspects_manage") end diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index 004fa2982..8783c0fad 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -12,7 +12,7 @@ describe PublicsController do end describe '#host_meta' do - it 'succeeds', :fixture => :rspec do + it 'succeeds', :fixture => true do get :host_meta response.should be_success response.body.should =~ /webfinger/ @@ -62,7 +62,7 @@ describe PublicsController do end describe '#hcard' do - it "succeeds", :fixture => :rspec do + it "succeeds", :fixture => true do post :hcard, "guid" => @user.person.guid.to_s response.should be_success save_fixture(response.body, "hcard", fixture_path) @@ -81,7 +81,7 @@ describe PublicsController do end describe '#webfinger' do - it "succeeds when the person and user exist locally", :fixture => :rspec do + it "succeeds when the person and user exist locally", :fixture => true do post :webfinger, 'q' => @user.person.diaspora_handle response.should be_success save_fixture(response.body, "webfinger", fixture_path) diff --git a/spec/controllers/status_messages_controller_spec.rb b/spec/controllers/status_messages_controller_spec.rb index 88f71831d..5ccb76abd 100644 --- a/spec/controllers/status_messages_controller_spec.rb +++ b/spec/controllers/status_messages_controller_spec.rb @@ -29,7 +29,7 @@ describe StatusMessagesController do response.should be_success end - it 'generates a jasmine fixture', :fixture => 'jasmine' do + it 'generates a jasmine fixture', :fixture => true do contact = alice.contact_for(bob.person) aspect = alice.aspects.create(:name => 'people') contact.aspects << aspect