Skip to content

Commit

Permalink
Emergency Bug Fix: Fixed order dependent CSRF spec. (#444)
Browse files Browse the repository at this point in the history
* fixed order dependent csrf test. Feels good.

* fix other order dep bug
  • Loading branch information
elorest authored Dec 13, 2017
1 parent 9cdc372 commit 439175e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/amber/router/pipe/csrf_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Amber
module Pipe
describe CSRF do
Dir.cd CURRENT_DIR
Amber.env = :test

context "when requests have HTTP methods" do
CSRF::CHECK_METHODS.each do |method|
Expand Down Expand Up @@ -60,7 +61,6 @@ module Amber

context "across requests" do
it "is valid across request" do
csrf = CSRF.new
request = HTTP::Request.new("GET", "/")
context = create_context(request)

Expand Down
1 change: 1 addition & 0 deletions spec/amber/router/session_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require "../../../spec_helper"
include SessionHelper

module Amber::Router
Amber.settings.redis_url = ENV["REDIS_URL"] if ENV["REDIS_URL"]?
describe Session::Store do
it "creates a cookie session store" do
session = create_session_config("signed_cookie")
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CURRENT_DIR = Dir.current

Amber.environment_path = "./spec/support/config"
Amber.env=(ENV[Amber::AMBER_ENV])
Amber.settings.redis_url = ENV["REDIS_URL"]? || Amber.settings.redis_url
Amber.settings.redis_url = ENV["REDIS_URL"] if ENV["REDIS_URL"]?

require "http"
require "spec"
Expand Down

0 comments on commit 439175e

Please sign in to comment.