mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
Remove unneeded specs from admin user
This commit is contained in:
parent
0359d73808
commit
b08e881a24
1 changed files with 5 additions and 33 deletions
|
@ -1,24 +1,9 @@
|
|||
require 'rails_helper'
|
||||
require 'cancan/matchers'
|
||||
|
||||
describe AdminUser do
|
||||
RSpec.describe AdminUser do
|
||||
context 'with invalid attribute' do
|
||||
before :all do
|
||||
@admin_user = AdminUser.new
|
||||
end
|
||||
|
||||
it 'should not be valid' do
|
||||
@admin_user.valid?
|
||||
@admin_user.errors.full_messages.should match_array([
|
||||
"Country code is missing",
|
||||
"Email Email is missing",
|
||||
"Email Email is missing",
|
||||
"Password Password is missing",
|
||||
"Password Password is missing",
|
||||
"Password confirmation is missing",
|
||||
"Roles is missing",
|
||||
"Username Username is missing"
|
||||
])
|
||||
before do
|
||||
@admin_user = described_class.new
|
||||
end
|
||||
|
||||
it 'should not have any versions' do
|
||||
|
@ -27,21 +12,10 @@ describe AdminUser do
|
|||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
before :all do
|
||||
before do
|
||||
@admin_user = Fabricate(:admin_user)
|
||||
end
|
||||
|
||||
it 'should be valid' do
|
||||
@admin_user.valid?
|
||||
@admin_user.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
it 'should be valid twice' do
|
||||
@admin_user = Fabricate(:admin_user)
|
||||
@admin_user.valid?
|
||||
@admin_user.errors.full_messages.should match_array([])
|
||||
end
|
||||
|
||||
it 'should have one version' do
|
||||
with_versioning do
|
||||
@admin_user.versions.should == []
|
||||
|
@ -56,9 +30,7 @@ describe AdminUser do
|
|||
@admin_user.valid?.should == true
|
||||
@admin_user.password = 'not confirmed'
|
||||
@admin_user.valid?
|
||||
@admin_user.errors.full_messages.should match_array([
|
||||
"Password confirmation doesn't match Password"
|
||||
])
|
||||
@admin_user.errors.full_messages.should match_array(["Password confirmation doesn't match Password"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue