Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2018-05-10 18:00:32 +0300
committerBrett Walker <bwalker@gitlab.com>2018-05-10 18:00:32 +0300
commit42d27f0b43df544bab2ad5bc4e082728d86c7388 (patch)
tree213e6f0c028d8f60fb4f68c22b710ac4102fbb7d /spec/models/concerns
parent8279df2c055abecfd51ef79b87fbcef5da37c618 (diff)
only issue a warning if column doesn't exist
Diffstat (limited to 'spec/models/concerns')
-rw-r--r--spec/models/concerns/sha_attribute_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/models/concerns/sha_attribute_spec.rb b/spec/models/concerns/sha_attribute_spec.rb
index 592feddf1dc..0d3beb6a6e3 100644
--- a/spec/models/concerns/sha_attribute_spec.rb
+++ b/spec/models/concerns/sha_attribute_spec.rb
@@ -36,24 +36,26 @@ describe ShaAttribute do
end
context 'when the table does not exist' do
- it 'allows the attribute to be added' do
+ it 'allows the attribute to be added and issues a warning' do
allow(model).to receive(:table_exists?).and_return(false)
expect(model).not_to receive(:columns)
expect(model).to receive(:attribute)
+ expect(model).to receive(:warn)
model.sha_attribute(:name)
end
end
context 'when the column does not exist' do
- it 'raises ArgumentError' do
+ it 'allows the attribute to be added and issues a warning' do
allow(model).to receive(:table_exists?).and_return(true)
expect(model).to receive(:columns)
- expect(model).not_to receive(:attribute)
+ expect(model).to receive(:attribute)
+ expect(model).to receive(:warn)
- expect { model.sha_attribute(:no_name) }.to raise_error(ArgumentError)
+ model.sha_attribute(:no_name)
end
end