Skip to content

Commit

Permalink
pass integration test.
Browse files Browse the repository at this point in the history
  • Loading branch information
saberma committed Aug 30, 2011
1 parent 0447d46 commit 921608c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/models/customer.rb
Expand Up @@ -13,7 +13,7 @@ class Customer < ActiveRecord::Base
devise :database_authenticatable, :registerable, :token_authenticatable,
:recoverable, :rememberable, :trackable#,:validatable

attr_accessible :id, :name, :email, :note, :accepts_marketing, :tags_text, :addresses_attributes, :password, :password_confirmation
attr_accessible :id, :name, :email, :orders_count, :note, :accepts_marketing, :tags_text, :addresses_attributes, :password, :password_confirmation
before_create :ensure_authentication_token # 生成login token,只使用一次
validates_presence_of :name, :email, :password
validates :email, uniqueness: {scope: :shop_id}, format: {with: Devise::Email::EXACT_PATTERN }
Expand Down
3 changes: 2 additions & 1 deletion spec/requests/domains_spec.rb
Expand Up @@ -29,6 +29,7 @@
click_on '新增一个您已经拥有的域名'
fill_in 'domain[host]', with: 'www.example.com'
click_on '绑定此域名'
has_content?('www.example.com').should be_true
page.execute_script("window.confirm = function(msg) { return true; }")
click_on '删除'
within '#domains > .items' do
Expand Down Expand Up @@ -80,7 +81,7 @@
end
end

it "should be force redirect" do # 重定向
it "should be force redirect" do # 重定向
within '#domains > .items' do
within :xpath, './tr[1]/td[3]' do
find('#shop_force_domain')['checked'].should be_false
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/shippings_spec.rb
Expand Up @@ -8,12 +8,12 @@
it "works! ", js: true do
visit shipping_index_path
click_on '增加'
select 'China', from: 'country_code'
select '中国', from: 'country_code'
click_on '保存'
page.should have_content('新增成功')

visit shipping_index_path
page.should have_content('China')
page.should have_content('中国')
find_field('weight_based_shipping_rate[name]').visible?.should be_false
find_field('weight_based_shipping_rate[weight_low]').visible?.should be_false
find_field('weight_based_shipping_rate[weight_high]').visible?.should be_false
Expand Down
2 changes: 2 additions & 0 deletions spec/requests/shopqi/login_spec.rb
Expand Up @@ -18,6 +18,7 @@
it "should show message" do
fill_in '商店Web地址', with: shop.primary_domain.subdomain
click_on 'log in'
sleep 3 # 等待页面跳转
has_content?('邮箱或密码错误').should be_true
end

Expand All @@ -26,6 +27,7 @@
fill_in 'Email' , with: 'admin@shopqi.com'
fill_in '密码' , with: '666666'
click_on 'log in'
sleep 3 # 等待页面跳转
has_content?('ShopQi欢迎您').should be_true
end

Expand Down
1 change: 1 addition & 0 deletions spec/requests/shopqi/registrations_spec.rb
Expand Up @@ -35,6 +35,7 @@
fill_in '手机验证码' , with: '8888'
check 'shop_terms_and_conditions' # 服务条款
click_on '创建我的ShopQi商店'
sleep 10 # 等待后台保存shop对象
has_content?('ShopQi欢迎您').should be_true
end

Expand Down

0 comments on commit 921608c

Please sign in to comment.