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

Fix Gemfile & Dockerfile to get passing tests #1732

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gemfile.lock
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ WORKDIR /srv
COPY Gemfile doorkeeper.gemspec /srv/
COPY lib/doorkeeper/version.rb /srv/lib/doorkeeper/version.rb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, I tried hacking this whilst working on #1735 and didn't quite get it right, I was doing:

 COPY Gemfile Gemfile.lock doorkeeper.gemspec lib/doorkeeper/version.rb /srv/

And it was failing to load the version file; I guess this explains why!


# This is a fix for sqlite alpine issues
RUN bundle config force_ruby_platform true
RUN bundle install

COPY . /srv/

RUN chown -R doorkeeper:doorkeeper /srv/coverage
RUN chown -R doorkeeper:doorkeeper /srv/coverage /srv/spec/dummy/tmp /srv/spec/generators/tmp

# Set the running user for resulting container
USER doorkeeper
Expand Down
13 changes: 6 additions & 7 deletions spec/requests/endpoints/authorization_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@

scenario "raises exception on forged requests" do
allowing_forgery_protection do
expect do
page.driver.post authorization_endpoint_url(
client_id: @client.uid,
redirect_uri: @client.redirect_uri,
response_type: "code",
)
end.to raise_error(ActionController::InvalidAuthenticityToken)
page.driver.post authorization_endpoint_url(
client_id: @client.uid,
redirect_uri: @client.redirect_uri,
response_type: "code",
)
expect(page).to have_http_status(422)
end
end
end
Expand Down
Loading