devise 1.1.pre → 1.1.pre2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of devise might be problematic. Click here for more details.

@@ -9,6 +9,14 @@
9
9
  * Rails 3 compatible only.
10
10
  * Scoped views are no longer "sessions/users/new". Now use "users/sessions/new".
11
11
 
12
+ == 1.0.2
13
+
14
+ * enhancements
15
+ * Allows you set mailer content type (by github.com/glennr)
16
+
17
+ * bug fix
18
+ * Uses the same content type as request on http authenticatable 401 responses
19
+
12
20
  == 1.0.1
13
21
 
14
22
  * enhancements
@@ -9,7 +9,7 @@ module Devise
9
9
  Devise.configure_warden(config)
10
10
  end
11
11
 
12
- config.after_initialize do
12
+ initializer "devise.load_orm" do
13
13
  require "devise/orm/#{Devise.orm}"
14
14
  end
15
15
  end
@@ -1,8 +1,7 @@
1
1
  module ActionDispatch::Routing
2
2
  class RouteSet #:nodoc:
3
3
  # Ensure Devise modules are included only after loading routes, because we
4
- # need devise_for mappings already declared to create magic filters and
5
- # helpers.
4
+ # need devise_for mappings already declared to create filters and helpers.
6
5
  def finalize_with_devise!
7
6
  finalize_without_devise!
8
7
  return if Devise.mappings.empty?
@@ -30,7 +30,7 @@ module Devise
30
30
 
31
31
  def custom_headers
32
32
  {
33
- "Content-Type" => "text/plain",
33
+ "Content-Type" => request.format.to_s,
34
34
  "WWW-Authenticate" => %(Basic realm="#{Devise.http_authentication_realm.gsub(/"/, "")}")
35
35
  }
36
36
  end
@@ -1,3 +1,3 @@
1
1
  module Devise
2
- VERSION = "1.1.pre".freeze
2
+ VERSION = "1.1.pre2".freeze
3
3
  end
@@ -16,6 +16,12 @@ class HttpAuthenticationTest < ActionController::IntegrationTest
16
16
  assert_equal 'Basic realm="Application"', headers["WWW-Authenticate"]
17
17
  end
18
18
 
19
+ test 'uses the request format as response content type' do
20
+ sign_in_as_new_user_with_http("unknown", "123456", :xml)
21
+ assert_equal 401, status
22
+ assert_equal "application/xml", headers["Content-Type"]
23
+ end
24
+
19
25
  test 'returns a custom response with www-authenticate and chosen realm' do
20
26
  swap Devise, :http_authentication_realm => "MyApp" do
21
27
  sign_in_as_new_user_with_http("unknown")
@@ -36,9 +42,9 @@ class HttpAuthenticationTest < ActionController::IntegrationTest
36
42
 
37
43
  private
38
44
 
39
- def sign_in_as_new_user_with_http(username="user@test.com", password="123456")
45
+ def sign_in_as_new_user_with_http(username="user@test.com", password="123456", format=:html)
40
46
  user = create_user
41
- get users_path, {}, "HTTP_AUTHORIZATION" => "Basic #{ActiveSupport::Base64.encode64("#{username}:#{password}")}"
47
+ get users_path(:format => format), {}, "HTTP_AUTHORIZATION" => "Basic #{ActiveSupport::Base64.encode64("#{username}:#{password}")}"
42
48
  user
43
49
  end
44
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.pre
4
+ version: 1.1.pre2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "Jos\xC3\xA9 Valim"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2010-02-17 00:00:00 +01:00
13
+ date: 2010-02-18 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency