Skip to content

Commit

Permalink
fun with lint
Browse files Browse the repository at this point in the history
  • Loading branch information
stonefilipczak committed Aug 28, 2024
1 parent acbed7e commit 0138b5f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
1 change: 1 addition & 0 deletions spec/requests/dashboard_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
RSpec.describe "DashboardController" do
describe "GET /" do
let(:user) { create_and_log_in_user }

before { get "/" }

it_behaves_like "a page with footer content"
Expand Down
10 changes: 4 additions & 6 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
def create_and_log_in_user
email = "[email protected]"
token = SecureRandom.uuid

user = User.create!({ email:, token: })

code = "ABC123"
login_gov = instance_double(LoginGov)
allow(LoginGov).to receive(:new).and_return(login_gov)
allow(login_gov).to receive(:exchange_token_from_auth_result).with(code).and_return(
[{ email:, sub: token }]
)
[{ email:, sub: token }]
)

get "/auth/result", params: { code: }
user
end
user
end
14 changes: 6 additions & 8 deletions spec/support/shared_examples/utility_menu.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@
end

RSpec.shared_examples "a page with utility menu links for an evaluator" do
it "has the right links for an evaluator" do
expect(response.body).to include("Dashboard")
expect(response.body).to include("Evaluations")
expect(response.body).to include("User Guides")
expect(response.body).to include("Help")
end
it "has the right links for an evaluator" do
expect(response.body).to include("Dashboard")
expect(response.body).to include("Evaluations")
expect(response.body).to include("User Guides")
expect(response.body).to include("Help")
end
end


0 comments on commit 0138b5f

Please sign in to comment.