Merge branch 'master' of github.com:domify/registry

Conflicts:
	config/locales/en.yml
	db/schema.rb
This commit is contained in:
Martin Lensment 2015-05-19 17:26:32 +03:00
commit 2fb632b7a9
21 changed files with 298 additions and 54 deletions

View file

@ -1,4 +1,7 @@
Fabricator(:registrant_verification) do
domain_name { sequence(:name) { |i| "domain#{i}.ee" } }
domain(fabricate: :domain)
verification_token '123'
action 'confirmed'
action_type 'registrant_change'
end

View file

@ -0,0 +1,44 @@
require 'rails_helper'
feature 'DomainDeleteConfirm', type: :feature do
context 'as unknown user with domain without token' do
before :all do
@domain = Fabricate(:domain)
end
it 'should see warning info if token is missing request' do
visit "/registrant/domain_delete_confirms/#{@domain.id}"
current_path.should == "/registrant/domain_delete_confirms/#{@domain.id}"
page.should have_text('Domain verification not available')
end
it 'should see warning info if token is missing request' do
visit "/registrant/domain_delete_confirms/#{@domain.id}"
current_path.should == "/registrant/domain_delete_confirms/#{@domain.id}"
page.should have_text('Domain verification not available')
end
end
context 'as unknown user with domain with token' do
before :all do
@domain = Fabricate(
:domain,
registrant_verification_token: '123',
registrant_verification_asked_at: Time.zone.now
)
@domain.domain_statuses.create(value: DomainStatus::PENDING_DELETE)
end
it 'should see warning info if token is missing in request' do
visit "/registrant/domain_delete_confirms/#{@domain.id}?token=wrong_token"
current_path.should == "/registrant/domain_delete_confirms/#{@domain.id}"
page.should have_text('Domain verification not available')
end
it 'should show domain info and confirm buttons' do
visit "/registrant/domain_delete_confirms/#{@domain.id}?token=123"
current_path.should == "/registrant/domain_delete_confirms/#{@domain.id}"
page.should_not have_text('Domain verification not available')
end
end
end

View file

@ -10,7 +10,10 @@ describe RegistrantVerification do
@registrant_verification.valid?
@registrant_verification.errors.full_messages.should match_array([
"Domain name is missing",
"Verification token is missing"
"Verification token is missing",
"Action is missing",
"Action type is missing",
"Domain is missing"
])
end
end