From ae3f869fd1f4326e26805606197dea4ea15c67bb Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 21 Jul 2015 17:37:33 -0700 Subject: Fix the "Reload with full diff" URL button On the first load, the merge request tabs would be requested in JSON format to render the HTML. This would cause the "Reload with full diff" button to create a link to diff.json. Closes #2041 --- spec/javascripts/merge_request_tabs_spec.js.coffee | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/javascripts') diff --git a/spec/javascripts/merge_request_tabs_spec.js.coffee b/spec/javascripts/merge_request_tabs_spec.js.coffee index 6cc96fb68a0..a0cfba455ea 100644 --- a/spec/javascripts/merge_request_tabs_spec.js.coffee +++ b/spec/javascripts/merge_request_tabs_spec.js.coffee @@ -51,6 +51,12 @@ describe 'MergeRequestTabs', -> expect(@subject('notes')).toBe('/foo/bar/merge_requests/1') expect(@subject('commits')).toBe('/foo/bar/merge_requests/1/commits') + it 'changes from diffs.html', -> + @class._location = stubLocation(pathname: '/foo/bar/merge_requests/1/diffs.html') + + expect(@subject('notes')).toBe('/foo/bar/merge_requests/1') + expect(@subject('commits')).toBe('/foo/bar/merge_requests/1/commits') + it 'changes from notes', -> @class._location = stubLocation(pathname: '/foo/bar/merge_requests/1') -- cgit v1.2.1