Commit 6c0f34bf authored by Etienne Baqué's avatar Etienne Baqué

Improved readability of modified rspec

parent 7f3c827a
......@@ -31,15 +31,12 @@ describe AuditEventsHelper do
expect(subject).to eq(custom_message)
end
context 'when the target_type is Operations::FeatureFlag' do
context 'when message relates to feature flags' do
let(:custom_message) { "Feature flag my_feature_flag was updated" }
let(:target_type) { 'Operations::FeatureFlag' }
context 'when custom message contains "_"' do
let(:custom_message) { "message_with_spaces" }
it 'does not replace them with spaces' do
expect(subject).to eq("message_with_spaces")
end
it 'shows message as is' do
is_expected.to eq(custom_message)
end
end
......
......@@ -67,14 +67,21 @@ describe Audit::Details do
expect(string).to eq('Changed access level from Guest to Owner')
end
end
end
context 'when the target_type is Operations::FeatureFlag' do
let(:target_type) { 'Operations::FeatureFlag' }
it 'leaves access_level as it is' do
string = described_class.humanize(member_access_action)
context 'feature flag' do
let(:feature_flag) do
{
remove: 'feature_flag',
target_type: 'Operations::FeatureFlag'
}
end
let(:custom_message) { "Removed feature_flag" }
expect(string).to eq('Changed access_level from Guest to Owner')
end
it 'shows message as is' do
string = described_class.humanize(feature_flag)
expect(string).to eq(custom_message)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment