More travis stuff

This commit is contained in:
Raphael Sofaer 2011-07-02 00:26:41 -07:00
parent ac832f160c
commit 3baf433b3a
7 changed files with 39 additions and 21 deletions

View file

@ -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"

10
Gemfile
View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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