Don't show rake output when running migrations_spec
This commit is contained in:
parent
fd2cbc1cf4
commit
646603ffe0
2 changed files with 6 additions and 7 deletions
|
|
@ -1,9 +1,8 @@
|
|||
namespace :migrations do
|
||||
|
||||
desc 'make old registered services into the new class specific services'
|
||||
|
||||
task :service_reclassify do
|
||||
require File.join(Rails.root,"config/environment")
|
||||
#include ActiveSupport::Inflector
|
||||
Service.all.each do |s|
|
||||
puts s.inspect
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@
|
|||
|
||||
require 'spec_helper'
|
||||
require File.join(Rails.root, 'lib/hcard')
|
||||
require "rake"
|
||||
|
||||
describe 'migrations' do
|
||||
|
||||
|
||||
describe 'service_reclassify' do
|
||||
it 'makes classless servcices have class' do
|
||||
s1 = Service.new(:access_token => "foo", :access_secret => "barbar", :provider => "facebook")
|
||||
|
|
@ -15,12 +14,13 @@ describe 'migrations' do
|
|||
s1.save
|
||||
s2.save
|
||||
|
||||
require "rake"
|
||||
@rake = Rake::Application.new
|
||||
Rake.application = @rake
|
||||
Rake.application.rake_require "lib/tasks/migrations", [Rails.root]
|
||||
Rake::Task.define_task(:environment)
|
||||
@rake['migrations:service_reclassify'].invoke
|
||||
Rake::Task.define_task(:environment) {}
|
||||
silence_stream(STDOUT) do
|
||||
silence_warnings { @rake['migrations:service_reclassify'].invoke }
|
||||
end
|
||||
|
||||
Service.all.any?{|x| x.class.name == "Services::Twitter"}.should be true
|
||||
Service.all.any?{|x| x.class.name == "Services::Facebook"}.should be true
|
||||
|
|
|
|||
Loading…
Reference in a new issue