Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe User do
- before do
- @user = User.new(name: "Bob Raily", email: "brailt@example.com",
- password: "foobar", password_confirmation: "foobar")
- end
- subject { @user }
- it { should respond_to(:name) }
- it { should respond_to(:email) }
- it { should respond_to(:password_digest) }
- it { should respond_to(:password) }
- it { should respond_to(:password_confirmation) }
- it { should respond_to(:authenticate) }
- it { should be_valid }
- describe "when name is not present" do
- before { @user.name = " " }
- it { should_not be_valid }
- end
- describe "when email is not present" do
- before { @user.email = " " }
- it { should_not be_valid }
- end
- # там ниже еще дохуя, но не суть
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement