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

Environment banner #72

Merged
merged 4 commits into from
Jun 5, 2017

Conversation

rdalin82
Copy link
Contributor

@rdalin82 rdalin82 commented Jun 4, 2017

fixes, #67, I haven't setup a test yet for the environment banner, if you need a test setup for it I'd recommend doing an integration test with capybara which I could setup. I didn't want to add the dependency to your project without your input first since it would be bringing in a library just to test one thing. I also added some color to the banner and made it center, hopefully it sticks out more.

I added a test for the X-Environment header, its not very expansive, but I think with a little guidance I could add more tests.

environmentbannerwithcolor

rdalin82 added 2 commits June 3, 2017 20:10
…ls.env except production, also added response header X-Environment which responses with the current Rails.env to be included in all v0 json requests
Copy link
Member

@Mr0grog Mr0grog left a comment

Choose a reason for hiding this comment

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

Thanks! I noted a few minor issues in the review.

I don’t think we really want or need to worry about the overhead of Capybara tests for this since the site is not really meant for browser use.

@@ -1,3 +1,10 @@
class ApplicationController < ActionController::Base
# pass
before_action :set_environment
Copy link
Member

Choose a reason for hiding this comment

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

Since there’s actual code in this class now, you should get rid of the # pass comment :)

@@ -11,10 +11,18 @@
</head>

<body>
<% unless @env == "production" %>
<header class="page-header">
Copy link
Member

Choose a reason for hiding this comment

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

This should really be inside the pre-existing header element (you’re only meant to have one per HTML “section” — this is, article, aside, nav, section elements). Otherwise we should make it a plain old div.

@@ -164,4 +164,8 @@ class Api::V0::PagesControllerTest < ActionDispatch::IntegrationTest
results = body['data']
assert_not results.any? {|p| p.key? 'versions'}, 'Some pages have a "versions" property'
end
test 'includes environment in header of response' do
Copy link
Member

Choose a reason for hiding this comment

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

Would you add a blank line between tests, please?

@Mr0grog
Copy link
Member

Mr0grog commented Jun 5, 2017

Looks awesome, thanks!

@Mr0grog Mr0grog merged commit 510ebbd into edgi-govdata-archiving:master Jun 5, 2017
@rdalin82
Copy link
Contributor Author

rdalin82 commented Jun 5, 2017

Really glad I could help. I checked out the goals of the overall project and you folks are doing some terrific work. Keep up the good work!

@Mr0grog
Copy link
Member

Mr0grog commented Jun 5, 2017

Thanks! I just realized we don’t have a “Contributors” section in the README, so I’m about to add one. Would you like to be listed there?

@rdalin82
Copy link
Contributor Author

rdalin82 commented Jun 5, 2017

That would be great thanks!

@Mr0grog
Copy link
Member

Mr0grog commented Jun 5, 2017

Feel free to update #75 if you’d like your link to point somewhere else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants