Skip to content
Browse files

fixed spec error, #406.

  • Loading branch information...
1 parent 49a6441 commit 4d0644db55c581227743b019ff5d87ddda329045 @saberma saberma committed Feb 21, 2012
View
2 db/migrate/20120219015553_change_basic_plan_to_free.rb
@@ -1,6 +1,7 @@
class ChangeBasicPlanToFree < ActiveRecord::Migration
def up # 406
+ change_column :shops, :plan, :string, default: 'free'
Shop.all.each do |shop|
shop.update_attributes! plan: 'free', deadline: nil if shop.plan == 'basic'
if shop.plan = 'basic'
@@ -12,6 +13,7 @@ def up # 406
end
def down
+ change_column :shops, :plan, :string, default: 'basic'
Shop.all.each do |shop|
if shop.plan = 'free'
shop.plan = 'basic'
View
2 db/schema.rb
@@ -614,7 +614,7 @@
create_table "shops", :force => true do |t|
t.string "name", :limit => 16
t.string "phone", :limit => 16
- t.string "plan", :limit => 16, :default => "basic"
+ t.string "plan", :default => "free"
t.date "deadline"
t.string "province", :limit => 8
t.string "city", :limit => 8
View
1 spec/factories/users.rb
@@ -6,6 +6,7 @@
shop_attributes({
name: '测试商店',
email: 'admin@shopqi.com',
+ plan: 'free',
domains_attributes: [{subdomain: 'shopqi', domain: Setting.store_host}]
})
password '666666'
View
4 spec/models/consumption_spec.rb
@@ -7,8 +7,8 @@
let(:consumption) { Factory(:consumption, shop: shop) }
it "should init price" do
- consumption.price.should eql 298.0
- consumption.total_price.should eql 596.0
+ consumption.price.should eql 2988.0
+ consumption.total_price.should eql 5976.0
end
end
View
2 spec/requests/shopqi/home_spec.rb
@@ -10,7 +10,7 @@
it "should be show" do
visit '/'
- has_content?('华丽的界面').should be_true
+ has_content?('华丽的商店界面').should be_true
end
end

0 comments on commit 4d0644d

Please sign in to comment.
Something went wrong with that request. Please try again.