mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-12 09:17:05 +02:00
31 lines
627 B
Ruby
31 lines
627 B
Ruby
require 'spec_helper'
|
|
|
|
describe User do
|
|
let(:user) { build(:user) }
|
|
|
|
describe "#valid?" do
|
|
it { user.should be_valid }
|
|
|
|
describe "name" do
|
|
it "nil is invalid" do
|
|
user.name = nil
|
|
user.should_not be_valid
|
|
end
|
|
|
|
it "taken name is invalid" do
|
|
another_user = create(:user)
|
|
user.name = another_user.name
|
|
user.should_not be_valid
|
|
end
|
|
end
|
|
|
|
describe "password" do
|
|
it "password != password_confirmation is invalid" do
|
|
user.password = "a"
|
|
user.password_confirmation = "b"
|
|
user.should_not be_valid
|
|
end
|
|
end
|
|
end
|
|
end
|