forked from zammad/zammad
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix auto-correctable rubocop offenses in test suite
- Loading branch information
Showing
119 changed files
with
1,405 additions
and
1,531 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 9 additions & 12 deletions
21
spec/db/migrate/issue_2333_object_country_already_exists_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,20 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe AddCountryAttributeToUsers, type: :db_migration do | ||
|
||
context 'AddCountryAttributeToUsers migration' do | ||
|
||
def country_attribute | ||
ObjectManager::Attribute.find_by(object_lookup_id: ObjectLookup.by_name('User'), name: 'country') | ||
end | ||
|
||
it 'preserves the existing country attribute' do | ||
expect { migrate } | ||
.not_to(change { country_attribute.present? }) | ||
.not_to change { ObjectManager::Attribute.find_by(object_lookup_id: ObjectLookup.by_name('User'), name: 'country') } | ||
end | ||
|
||
it 'adds the country attribute when it is not present' do | ||
country_attribute.delete | ||
expect { migrate } | ||
.to change { country_attribute.present? } | ||
.from( false ).to( true ) | ||
context 'when country attribute is not present' do | ||
before { ObjectManager::Attribute.find_by(object_lookup_id: ObjectLookup.by_name('User'), name: 'country').delete } | ||
|
||
it 'adds the country attribute when it is not present' do | ||
expect { migrate } | ||
.to change { ObjectManager::Attribute.exists?(object_lookup_id: ObjectLookup.by_name('User'), name: 'country') } | ||
.from(false).to(true) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.