ZOMG specs pass on mysql!

Make '_type' column on services into 'type'.
This commit is contained in:
Sarah Mei 2010-12-28 21:08:54 -08:00
parent fd74b79b61
commit f18439fa14
5 changed files with 6 additions and 4 deletions

View file

@ -131,7 +131,7 @@ class CreateSchema < ActiveRecord::Migration
add_index :requests, [:sender_id, :recipient_id], :unique => true
create_table :services do |t|
t.string :_type
t.string :type
t.integer :user_id
t.string :provider
t.string :uid

View file

@ -162,7 +162,7 @@ ActiveRecord::Schema.define(:version => 0) do
add_index "requests", ["sender_id"], :name => "index_requests_on_sender_id"
create_table "services", :force => true do |t|
t.string "_type"
t.string "type"
t.integer "user_id"
t.string "provider"
t.string "uid"

View file

@ -5,7 +5,7 @@ module PhotoMover
FileUtils::mkdir_p temp_dir
Dir.chdir 'tmp/exports'
photos = user.visible_posts(:person_id => user.person.id, :_type => 'Photo')
photos = user.visible_posts(:person_id => user.person.id, :type => 'Photo')
photos_dir = "#{user.id}/photos"
FileUtils::mkdir_p photos_dir

View file

@ -62,9 +62,11 @@ describe ServicesController do
it 'creates a twitter service' do
Service.delete_all
user.getting_started = false
request.env['omniauth.auth'] = omniauth_auth
post :create
user.reload
user.services.first.class.name.should == "Services::Twitter"
end
end

View file

@ -72,7 +72,7 @@ Factory.define :service do |service|
service.sequence(:access_token) { |token| "12345#{token}" }
service.sequence(:access_secret) { |token| "98765#{token}" }
service.after_build do |s|
s._type = "Services::#{s.provider.camelize}"
s.type = "Services::#{s.provider.camelize}"
end
end