|
14 | 14 | describe "GET #show" do |
15 | 15 | context "when authenticated and authorized" do |
16 | 16 | it "returns http success" do |
17 | | - get :show, params: { casa_case_id: casa_case.friendly_id } |
| 17 | + get :show, params: {casa_case_id: casa_case.friendly_id} |
18 | 18 | expect(response).to have_http_status(:success) |
19 | 19 | end |
20 | 20 |
|
21 | 21 | it "assigns @current_case" do |
22 | | - get :show, params: { casa_case_id: casa_case.friendly_id } |
| 22 | + get :show, params: {casa_case_id: casa_case.friendly_id} |
23 | 23 | expect(assigns(:current_case)).to eq(casa_case) |
24 | 24 | end |
25 | 25 |
|
26 | 26 | it "assigns @emancipation_form_data with all categories" do |
27 | | - get :show, params: { casa_case_id: casa_case.friendly_id } |
| 27 | + get :show, params: {casa_case_id: casa_case.friendly_id} |
28 | 28 | expect(assigns(:emancipation_form_data)).to match_array(EmancipationCategory.all) |
29 | 29 | end |
30 | 30 | end |
31 | 31 |
|
32 | 32 | context "when case does not exist" do |
33 | 33 | it "raises a record not found error" do |
34 | 34 | expect { |
35 | | - get :show, params: { casa_case_id: "nonexistent-case" } |
| 35 | + get :show, params: {casa_case_id: "nonexistent-case"} |
36 | 36 | }.to raise_error(ActiveRecord::RecordNotFound) |
37 | 37 | end |
38 | 38 | end |
|
41 | 41 | let(:user) { create(:supervisor, casa_org: other_org) } |
42 | 42 |
|
43 | 43 | it "redirects to root with an authorization notice" do |
44 | | - get :show, params: { casa_case_id: casa_case.friendly_id } |
| 44 | + get :show, params: {casa_case_id: casa_case.friendly_id} |
45 | 45 | expect(response).to redirect_to(root_url) |
46 | 46 | expect(flash[:notice]).to match(/not authorized/) |
47 | 47 | end |
48 | 48 | end |
49 | 49 |
|
50 | 50 | context "docx format" do |
51 | 51 | it "sends a docx file with the correct filename" do |
52 | | - get :show, params: { casa_case_id: casa_case.friendly_id }, format: :docx |
| 52 | + get :show, params: {casa_case_id: casa_case.friendly_id}, format: :docx |
53 | 53 | expect(response.headers["Content-Disposition"]).to include( |
54 | 54 | "#{casa_case.case_number} Emancipation Checklist.docx" |
55 | 55 | ) |
|
0 commit comments