Skip to content

Commit

Permalink
fixed rspec error.
Browse files Browse the repository at this point in the history
  • Loading branch information
saberma committed Feb 6, 2012
1 parent 5139aef commit 3aa6b67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app/assets/javascripts/backbone/models/payment.js.coffee
Expand Up @@ -11,7 +11,10 @@ App.Models.Payment = Backbone.Model.extend
if attrs.payment_type_id is 1 # 支付宝
errors["合作者身份ID"] = "不能为空." if attrs.partner is ''
errors["帐号"] = "不能为空." if attrs.account is ''
errors["交易安全校验码"] = "不能为空." if attrs.key is '' # 新增时才校验
errors["交易安全校验码"] = "不能为空." if !@id? and (!attrs.key? or attrs.key is '') # 新增时才校验
if attrs.payment_type_id is 2 # 财付通
errors["商户号"] = "不能为空." if attrs.partner is ''
errors["交易安全校验码"] = "不能为空." if !@id? and (!attrs.key? or attrs.key is '') # 新增时才校验
else # 自定义支付方式
errors["方式"] = "不能为空." if attrs.name is ''

Expand All @@ -25,7 +28,7 @@ App.Models.Payment = Backbone.Model.extend
toJSON : ->
@unset 'service_name', silent: true
@unset 'id', silent: true
attrs = this.wrappedAttributes()
attrs = @wrappedAttributes()

App.Collections.Payments = Backbone.Collection.extend
model: App.Models.Payment
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/payments_spec.rb
Expand Up @@ -16,7 +16,7 @@

before { visit payments_path }

it "should be config", f: true do # 配置
it "should be config" do # 配置
within '#payment_alipay' do
select '使用支付宝'
find('.account_payment_provider').visible?.should be_true
Expand Down

0 comments on commit 3aa6b67

Please sign in to comment.