Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

simulate #227, when required fields are not accessible sign up fails …

…hard
  • Loading branch information...
commit 2b8f2f601583d382297f19fcf6e6af336682fbec 1 parent a1d195b
@ashchan ashchan authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/requests/signup_login_spec.rb
View
15 spec/requests/signup_login_spec.rb
@@ -25,4 +25,19 @@
click_button '登录'
page.should have_content('活跃帖子')
end
+
+ it "fail to sign up new user if password field is protected" do
+ User.class_eval do
+ attr_protected :password
+ end
+
+ visit '/'
+ click_link '注册'
+ fill_in '用户名', :with => 'rubyist'
+ fill_in 'Email', :with => 'rubyist@ruby-china.org'
+ fill_in '密码', :with => 'coolguy'
+ fill_in '确认密码', :with => 'coolguy'
+ click_button '提交注册信息'
+ page.should have_content('密码 不能为空字符')
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.