Skip to content

Commit

Permalink
fixed spec error, saberma#406.
Browse files Browse the repository at this point in the history
  • Loading branch information
saberma committed Feb 21, 2012
1 parent 49a6441 commit 4d0644d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions 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'
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions spec/factories/users.rb
Expand Up @@ -6,6 +6,7 @@
shop_attributes({
name: '测试商店',
email: 'admin@shopqi.com',
plan: 'free',
domains_attributes: [{subdomain: 'shopqi', domain: Setting.store_host}]
})
password '666666'
Expand Down
4 changes: 2 additions & 2 deletions spec/models/consumption_spec.rb
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/requests/shopqi/home_spec.rb
Expand Up @@ -10,7 +10,7 @@

it "should be show" do
visit '/'
has_content?('华丽的界面').should be_true
has_content?('华丽的商店界面').should be_true
end

end
Expand Down

0 comments on commit 4d0644d

Please sign in to comment.