diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-07 18:39:53 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-11-07 18:39:53 +0300 |
commit | 2a2fab68052dd46fad3d29a7eeedbc36ee772fa0 (patch) | |
tree | 4dd54d296bb780a2573816ec8b155b529f41cc2a /spec | |
parent | 3f35ba769a6db924b82939b996fdd7631ddf2377 (diff) | |
parent | ad6e650262c1c152fe5e7d7a09607286b8f9f750 (diff) |
Merge branch 'jk-backport-issuables-refactor' into 'master'
Refactor issuables index actions
See merge request gitlab-org/gitlab-ce!15242
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/concerns/issuable_collections_spec.rb | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/spec/controllers/concerns/issuable_collections_spec.rb b/spec/controllers/concerns/issuable_collections_spec.rb index c9687af4dd2..cd3bf785d34 100644 --- a/spec/controllers/concerns/issuable_collections_spec.rb +++ b/spec/controllers/concerns/issuable_collections_spec.rb @@ -17,60 +17,6 @@ describe IssuableCollections do controller end - describe '#redirect_out_of_range' do - before do - allow(controller).to receive(:url_for) - end - - it 'returns true and redirects if the offset is out of range' do - relation = double(:relation, current_page: 10) - - expect(controller).to receive(:redirect_to) - expect(controller.send(:redirect_out_of_range, relation, 2)).to eq(true) - end - - it 'returns false if the offset is not out of range' do - relation = double(:relation, current_page: 1) - - expect(controller).not_to receive(:redirect_to) - expect(controller.send(:redirect_out_of_range, relation, 2)).to eq(false) - end - end - - describe '#issues_page_count' do - it 'returns the number of issue pages' do - project = create(:project, :public) - - create(:issue, project: project) - - finder = IssuesFinder.new(user) - issues = finder.execute - - allow(controller).to receive(:issues_finder) - .and_return(finder) - - expect(controller.send(:issues_page_count, issues)).to eq(1) - end - end - - describe '#merge_requests_page_count' do - it 'returns the number of merge request pages' do - project = create(:project, :public) - - create(:merge_request, source_project: project, target_project: project) - - finder = MergeRequestsFinder.new(user) - merge_requests = finder.execute - - allow(controller).to receive(:merge_requests_finder) - .and_return(finder) - - pages = controller.send(:merge_requests_page_count, merge_requests) - - expect(pages).to eq(1) - end - end - describe '#page_count_for_relation' do it 'returns the number of pages' do relation = double(:relation, limit_value: 20) |