ZOMG specs pass on mysql!
Make '_type' column on services into 'type'.
This commit is contained in:
parent
fd74b79b61
commit
f18439fa14
5 changed files with 6 additions and 4 deletions
|
|
@ -131,7 +131,7 @@ class CreateSchema < ActiveRecord::Migration
|
||||||
add_index :requests, [:sender_id, :recipient_id], :unique => true
|
add_index :requests, [:sender_id, :recipient_id], :unique => true
|
||||||
|
|
||||||
create_table :services do |t|
|
create_table :services do |t|
|
||||||
t.string :_type
|
t.string :type
|
||||||
t.integer :user_id
|
t.integer :user_id
|
||||||
t.string :provider
|
t.string :provider
|
||||||
t.string :uid
|
t.string :uid
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ ActiveRecord::Schema.define(:version => 0) do
|
||||||
add_index "requests", ["sender_id"], :name => "index_requests_on_sender_id"
|
add_index "requests", ["sender_id"], :name => "index_requests_on_sender_id"
|
||||||
|
|
||||||
create_table "services", :force => true do |t|
|
create_table "services", :force => true do |t|
|
||||||
t.string "_type"
|
t.string "type"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.string "provider"
|
t.string "provider"
|
||||||
t.string "uid"
|
t.string "uid"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ module PhotoMover
|
||||||
FileUtils::mkdir_p temp_dir
|
FileUtils::mkdir_p temp_dir
|
||||||
Dir.chdir 'tmp/exports'
|
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"
|
photos_dir = "#{user.id}/photos"
|
||||||
FileUtils::mkdir_p photos_dir
|
FileUtils::mkdir_p photos_dir
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,11 @@ describe ServicesController do
|
||||||
|
|
||||||
|
|
||||||
it 'creates a twitter service' do
|
it 'creates a twitter service' do
|
||||||
|
Service.delete_all
|
||||||
user.getting_started = false
|
user.getting_started = false
|
||||||
request.env['omniauth.auth'] = omniauth_auth
|
request.env['omniauth.auth'] = omniauth_auth
|
||||||
post :create
|
post :create
|
||||||
|
user.reload
|
||||||
user.services.first.class.name.should == "Services::Twitter"
|
user.services.first.class.name.should == "Services::Twitter"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ Factory.define :service do |service|
|
||||||
service.sequence(:access_token) { |token| "12345#{token}" }
|
service.sequence(:access_token) { |token| "12345#{token}" }
|
||||||
service.sequence(:access_secret) { |token| "98765#{token}" }
|
service.sequence(:access_secret) { |token| "98765#{token}" }
|
||||||
service.after_build do |s|
|
service.after_build do |s|
|
||||||
s._type = "Services::#{s.provider.camelize}"
|
s.type = "Services::#{s.provider.camelize}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue