-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from dmacvicar/dmacvicar_error_messages
Better feedback on a wrongly configured (OBS auth) instance
- Loading branch information
Showing
5 changed files
with
37 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<% @page_title = "Error" -%> | ||
|
||
<div class="box box-shadow"> | ||
<h2 class="box-header"> | ||
<span class="alignleft"><%= @page_title -%></span></h2> | ||
<div> | ||
<% @page_title = "Error" if @page_title.blank? -%> | ||
|
||
<div class="container"> | ||
<h2Y<%= @page_title -%></h2> | ||
<div class="alert alert-danger"> | ||
<p><%=h @message %></p> | ||
|
||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require File.expand_path('../../test_helper', __FILE__) | ||
|
||
class ValidateConfigurationTest < ActionDispatch::IntegrationTest | ||
def test_validate_configuration | ||
# Fake that authentication is not configured | ||
x = Rails.configuration.x.clone | ||
Rails.configuration.x.api_username = nil | ||
Rails.configuration.x.opensuse_cookie = nil | ||
|
||
visit '/' | ||
page.assert_text 'The authentication to the OBS API has not been configured correctly.' | ||
assert_equal 503, page.status_code | ||
|
||
# Restore normal configuration values for other tests | ||
Rails.configuration.x = x | ||
end | ||
end |