diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 00:07:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-10 00:07:56 +0000 |
commit | 775816e676aae53509d7b6f364945f2720636f72 (patch) | |
tree | 0baa821597f08edce720b236b0c07a6d13893f85 /qa/spec | |
parent | e98d69bc8b8b926a727d36e37d2ee30c9fa28907 (diff) | |
download | gitlab-ce-775816e676aae53509d7b6f364945f2720636f72.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'qa/spec')
-rw-r--r-- | qa/spec/page/base_spec.rb | 16 | ||||
-rw-r--r-- | qa/spec/page/logging_spec.rb | 8 |
2 files changed, 20 insertions, 4 deletions
diff --git a/qa/spec/page/base_spec.rb b/qa/spec/page/base_spec.rb index e157eb6ac3e..88d0eac40e6 100644 --- a/qa/spec/page/base_spec.rb +++ b/qa/spec/page/base_spec.rb @@ -91,4 +91,20 @@ describe QA::Page::Base do end end end + + describe '#all_elements' do + before do + allow(subject).to receive(:all) + end + + it 'raises an error if count or minimum are not specified' do + expect { subject.all_elements(:foo) }.to raise_error ArgumentError + end + + it 'does not raise an error if :minimum, :maximum, :count, or :between is specified' do + [:minimum, :maximum, :count, :between].each do |param| + expect { subject.all_elements(:foo, param => 1) }.not_to raise_error + end + end + end end diff --git a/qa/spec/page/logging_spec.rb b/qa/spec/page/logging_spec.rb index 0a394e1c38f..0d68f4bdae9 100644 --- a/qa/spec/page/logging_spec.rb +++ b/qa/spec/page/logging_spec.rb @@ -145,18 +145,18 @@ describe QA::Support::Page::Logging do it 'logs the number of elements found' do allow(page).to receive(:all).and_return([1, 2]) - expect { subject.all_elements(:element) } + expect { subject.all_elements(:element, count: 2) } .to output(/finding all :element/).to_stdout_from_any_process - expect { subject.all_elements(:element) } + expect { subject.all_elements(:element, count: 2) } .to output(/found 2 :element/).to_stdout_from_any_process end it 'logs 0 if no elements are found' do allow(page).to receive(:all).and_return([]) - expect { subject.all_elements(:element) } + expect { subject.all_elements(:element, count: 1) } .to output(/finding all :element/).to_stdout_from_any_process - expect { subject.all_elements(:element) } + expect { subject.all_elements(:element, count: 1) } .not_to output(/found 0 :elements/).to_stdout_from_any_process end end |