Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jw export to excel bug #580

Merged
merged 2 commits into from
Jul 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -34,7 +34,7 @@
%button.btn.btn-sm.btn-warning#admin_approvals_button{ data: { sub_service_request_id: sub_service_request.id }}
= t(:dashboard)[:sub_service_requests][:tabs][:request_details][:options][:core_approvals]
%td.text-center
= link_to t(:dashboard)[:sub_service_requests][:tabs][:request_details][:options][:export_to_excel], service_request_path(service_request, format: :xlsx, admin_offset: 1), :class => "export_to_excel_button btn btn-sm btn-primary"
= link_to t(:dashboard)[:sub_service_requests][:tabs][:request_details][:options][:export_to_excel], service_request_path(service_request, format: :xlsx, admin_offset: 1, sub_service_request_id: sub_service_request.id), :class => "export_to_excel_button btn btn-sm btn-primary"
%td.text-center
%button.btn.btn-sm.btn-danger#delete_ssr_button{ data: { sub_service_request_id: sub_service_request.id }}
%span
Expand Down
Expand Up @@ -3,6 +3,16 @@
RSpec.describe 'dashboard/sub_service_requests/_request_details', type: :view do
include RSpecHtmlMatchers

context "Export to excel" do
it "should display service_request_id and sub_service_request_id in href" do
protocol = stub_protocol
service_request = stub_service_request(protocol: protocol)
sub_service_request = stub_sub_service_request(service_request: service_request)
render_request_details(protocol: protocol, service_request: service_request, sub_service_request: sub_service_request)
expect(response).to have_tag('a', with: { href: "/service_requests/#{service_request.id}.xlsx?admin_offset=1&sub_service_request_id=#{sub_service_request.id}" }, text: "Export to Excel")
end
end

context "USE_EPIC truthy" do
it "should display 'Send to Epic' button" do
stub_const("USE_EPIC", true)
Expand Down