mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
test case: BUGFIX ensure test setup, new Domain object for each instance
before :all runs once per context, before :example runs for each it block be sure test cases with hacks/forced changes do not impact later tests
This commit is contained in:
parent
53695c3647
commit
e702cbde95
1 changed files with 8 additions and 3 deletions
|
@ -64,10 +64,15 @@ describe Domain do
|
|||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
before :all do
|
||||
before :example do
|
||||
@domain = Fabricate(:domain)
|
||||
end
|
||||
|
||||
after do
|
||||
@domain.delete
|
||||
@domain = nil
|
||||
end
|
||||
|
||||
it 'should be valid' do
|
||||
@domain.valid?
|
||||
@domain.errors.full_messages.should match_array([])
|
||||
|
@ -458,7 +463,7 @@ describe Domain do
|
|||
end
|
||||
|
||||
context 'about registrant update confirm' do
|
||||
before :all do
|
||||
before :example do
|
||||
@domain.registrant_verification_token = 123
|
||||
@domain.registrant_verification_asked_at = Time.zone.now
|
||||
@domain.statuses << DomainStatus::PENDING_UPDATE
|
||||
|
@ -479,7 +484,7 @@ describe Domain do
|
|||
end
|
||||
|
||||
context 'about registrant update confirm when domain is invalid' do
|
||||
before :all do
|
||||
before :example do
|
||||
@domain.registrant_verification_token = 123
|
||||
@domain.registrant_verification_asked_at = Time.zone.now
|
||||
@domain.statuses << DomainStatus::PENDING_UPDATE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue