Merge branch 'lh_292'
Conflicts: History.txt
This commit is contained in:
commit
3bd7266ab9
@ -20,6 +20,7 @@ CHANGED: Due to a reorganization, if you're currently requiring "webrat/rspec-ra
|
||||
|
||||
* Bug fixes
|
||||
|
||||
* Remove newlines from HTTP Basic authentication credentials (Michael Klett)
|
||||
* Require nokogiri form rspec-rails.rb (David Chelimsky)
|
||||
* Fix logger issue when running inside Cucumber (Damian Janowski)
|
||||
* Fix various issues related to submitting values with HTML entities (Kieran P)
|
||||
|
@ -105,7 +105,7 @@ For example:
|
||||
end
|
||||
|
||||
def basic_auth(user, pass)
|
||||
encoded_login = ["#{user}:#{pass}"].pack("m*")
|
||||
encoded_login = ["#{user}:#{pass}"].pack("m*").gsub(/\n/, '')
|
||||
header('HTTP_AUTHORIZATION', "Basic #{encoded_login}")
|
||||
end
|
||||
|
||||
|
@ -6,7 +6,7 @@ describe "Basic Auth HTTP headers" do
|
||||
end
|
||||
|
||||
it "should be present in visit" do
|
||||
webrat_session.should_receive(:get).with("/", {}, {'HTTP_AUTHORIZATION' => "Basic dXNlcjpzZWNyZXQ=\n"})
|
||||
webrat_session.should_receive(:get).with("/", {}, {'HTTP_AUTHORIZATION' => "Basic dXNlcjpzZWNyZXQ="})
|
||||
visit("/")
|
||||
end
|
||||
|
||||
@ -18,7 +18,18 @@ describe "Basic Auth HTTP headers" do
|
||||
</form>
|
||||
</html>
|
||||
HTML
|
||||
webrat_session.should_receive(:post).with("/form1", {}, {'HTTP_AUTHORIZATION' => "Basic dXNlcjpzZWNyZXQ=\n"})
|
||||
webrat_session.should_receive(:post).with("/form1", {}, {'HTTP_AUTHORIZATION' => "Basic dXNlcjpzZWNyZXQ="})
|
||||
click_button
|
||||
end
|
||||
|
||||
context "with long username and password combination" do
|
||||
before do
|
||||
basic_auth('user', 'secret1234567890123456789012345678901234567890123456789012345678901234567890')
|
||||
end
|
||||
|
||||
it "should be present, without new lines, in visit" do
|
||||
webrat_session.should_receive(:get).with("/", {}, {'HTTP_AUTHORIZATION' => "Basic dXNlcjpzZWNyZXQxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkw"})
|
||||
visit("/")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user