Skip to content

Commit

Permalink
Merge branch 'master' into simplify-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
GUI committed Feb 5, 2017
2 parents 8e33881 + a83fd74 commit 92a2c4b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/admin_ui/test_apis_reordering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def setup
def test_toggle_drag_handles
admin_login
visit "/admin/#/apis"
refute_selector(".busy-blocker")
assert_text("API A")

refute_selector("tbody td.reorder-handle")
click_button "Reorder"
Expand All @@ -30,6 +32,8 @@ def test_toggle_drag_handles
def test_remove_filters_while_reordering
admin_login
visit "/admin/#/apis"
refute_selector(".busy-blocker")
assert_text("API A")

assert_selector("tbody tr", :count => 4)
find(".dataTables_filter input").set("testing-fi")
Expand All @@ -41,6 +45,8 @@ def test_remove_filters_while_reordering
def test_forces_sorting_while_reordering
admin_login
visit "/admin/#/apis"
refute_selector(".busy-blocker")
assert_text("API A")

assert_selector("tbody tr:first-child td:first-child", :text => "API A")
click_button "Reorder"
Expand All @@ -50,6 +56,8 @@ def test_forces_sorting_while_reordering
def test_exits_reorder_mode_on_filter
admin_login
visit "/admin/#/apis"
refute_selector(".busy-blocker")
assert_text("API A")

click_button "Reorder"
assert_selector("tbody td.reorder-handle", :count => 4)
Expand All @@ -60,6 +68,8 @@ def test_exits_reorder_mode_on_filter
def test_exit_reorder_mode_on_sort
admin_login
visit "/admin/#/apis"
refute_selector(".busy-blocker")
assert_text("API A")

click_button "Reorder"
assert_selector("tbody td.reorder-handle", :count => 4)
Expand All @@ -70,6 +80,8 @@ def test_exit_reorder_mode_on_sort
def test_reordering_on_drag
admin_login
visit "/admin/#/apis"
refute_selector(".busy-blocker")
assert_text("API A")

names = Api.order_by(:sort_order.asc).all.map { |api| api.name }
assert_equal(["API B", "API C", "API A", "API testing-filter"], names)
Expand Down
2 changes: 2 additions & 0 deletions test/admin_ui/test_elasticsearch_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ def setup
end

def test_redirect_to_login_for_unauthenticated_requests
FactoryGirl.create(:admin)

visit "/admin/elasticsearch"
assert_text("You need to sign in")
refute_text('"lucene_version"')
Expand Down
2 changes: 2 additions & 0 deletions test/proxy/test_security_headers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def test_adds_security_headers_to_static_site
end

def test_adds_security_headers_to_web_app
FactoryGirl.create(:admin)
response = Typhoeus.get("https://127.0.0.1:9081/admin/login", keyless_http_options)
assert_response_code(200, response)
assert_equal("1; mode=block", response.headers["X-XSS-Protection"])
Expand All @@ -26,6 +27,7 @@ def test_adds_security_headers_to_web_app
end

def test_adds_security_headers_to_admin_ui
FactoryGirl.create(:admin)
response = Typhoeus.get("https://127.0.0.1:9081/admin/login", keyless_http_options)
assert_response_code(200, response)
assert_equal("1; mode=block", response.headers["X-XSS-Protection"])
Expand Down

0 comments on commit 92a2c4b

Please sign in to comment.