|
|
|
@ -12,6 +12,11 @@ describe User do
|
|
|
|
|
it { should respond_to(:login) }
|
|
|
|
|
it { should respond_to(:mail) }
|
|
|
|
|
|
|
|
|
|
#此处采用与构建的方式生成数据
|
|
|
|
|
# it"is invalid without login" do
|
|
|
|
|
# user=FactoryGirl.build(:user,login: nil)
|
|
|
|
|
# expect(user).to_not be_valid
|
|
|
|
|
# end
|
|
|
|
|
#用户名唯一性的测试
|
|
|
|
|
describe "when login is already taken" do
|
|
|
|
|
before do
|
|
|
|
|