Skip to content

Commit f35d90e

Browse files
committed
shared context 'when user is not authenticated' applied in all requests tests
test: add shared context for unauthenticated access shared_context 'when user is not authenticated' added to some request tests refactored tests using shared_context 'when user is not authenticated' shared context 'when user is not authenticated' applied in all requests tests shared context 'when user is not authenticated' applied in all requests tests test: add shared context for unauthenticated access shared_context 'when user is not authenticated' added to some request tests refactored tests using shared_context 'when user is not authenticated' shared context 'when user is not authenticated' applied in all requests tests
1 parent d5f35f8 commit f35d90e

11 files changed

+257
-482
lines changed

spec/requests/api/v1/event_procedures_dashboard_request_spec.rb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,9 @@
88
let(:params) { { start_date: "01/06/2000", end_date: "05/06/2000" } }
99

1010
describe "authentication" do
11-
context "when user is not authenticated" do
12-
let(:params) { {} }
13-
let(:headers) { {} }
14-
15-
it "returns unauthorized" do
16-
do_request
17-
expect(response).to have_http_status(:unauthorized)
18-
end
19-
20-
it "returns error message" do
21-
do_request
22-
expect(response.parsed_body["error_description"]).to eq(["Invalid token"])
23-
end
11+
include_context "when user is not authenticated" do
12+
let(:path) { "/api/v1/event_procedures_dashboard/amount_by_day" }
13+
let(:http_method) { :get }
2414
end
2515

2616
context "when user is authenticated as not admin" do

0 commit comments

Comments
 (0)