Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed test and code to accomodate rails 4

  • Loading branch information...
commit 0f02d7aad93d5988b4bf3ee1b0eb9cf973ebb013 1 parent 51cd387
@Systho Systho authored
Showing with 197 additions and 143 deletions.
  1. +2 −0  .gitignore
  2. +5 −0 Gemfile
  3. +76 −56 Gemfile.lock
  4. +10 −7 app/controllers/masq/accounts_controller.rb
  5. +11 −2 app/controllers/masq/personas_controller.rb
  6. +13 −7 app/controllers/masq/server_controller.rb
  7. +5 −1 app/controllers/masq/sites_controller.rb
  8. +4 −4 app/models/masq/account.rb
  9. +1 −1  app/models/masq/open_id_request.rb
  10. +1 −1  app/models/masq/persona.rb
  11. +1 −1  app/models/masq/release_policy.rb
  12. +1 −1  app/models/masq/site.rb
  13. +1 −1  app/views/masq/personas/index.html.erb
  14. +35 −6 app/views/masq/server/decide.html.erb
  15. +1 −1  app/views/masq/sites/edit.html.erb
  16. +1 −1  app/views/masq/sites/index.html.erb
  17. +6 −6 config/routes.rb
  18. +1 −1  lib/masq/active_record_openid_store/association.rb
  19. +1 −1  lib/masq/active_record_openid_store/nonce.rb
  20. +1 −1  masq.gemspec
  21. +0 −5 test/dummy/config/application.rb
  22. +5 −20 test/dummy/config/database.yml
  23. +2 −4 test/dummy/config/environments/development.rb
  24. +2 −0  test/dummy/config/environments/production.rb
  25. +2 −4 test/dummy/config/environments/test.rb
  26. +1 −1  test/dummy/config/initializers/secret_token.rb
  27. +0 −1  test/functional/masq/accounts_controller_test.rb
  28. +0 −1  test/functional/masq/info_controller_test.rb
  29. +0 −1  test/functional/masq/passwords_controller_test.rb
  30. +0 −1  test/functional/masq/personas_controller_test.rb
  31. +0 −1  test/functional/masq/server_controller_test.rb
  32. +1 −1  test/functional/masq/sessions_controller_test.rb
  33. +1 −2  test/functional/masq/sites_controller_test.rb
  34. +1 −1  test/functional/masq/yubikey_associations_controller_test.rb
  35. +1 −1  test/integration/openid_user_stories_test.rb
  36. +4 −0 test/test_helper.rb
View
2  .gitignore
@@ -17,3 +17,5 @@ test/dummy/tmp
test/dummy/.sass-cache
tmp
vendor/ruby
+.idea
+.rbenv-version
View
5 Gemfile
@@ -17,6 +17,11 @@ group :development, :test do
gem 'ruby_gntp'
gem 'guard-minitest'
gem 'rb-fsevent', :require => false
+
+ # rails 4 is still in beta not in rc
+ gem 'rails', :github => 'rails/rails', :branch => 'master'
+ gem 'journey', :github => 'rails/journey', :branch => 'master'
+ gem 'arel', :github => 'rails/arel', :branch => 'master'
end
gemspec
View
132 Gemfile.lock
@@ -1,9 +1,66 @@
+GIT
+ remote: git://github.com/rails/arel.git
+ revision: 38d0a222e275d917a2c1d093b24457bafb600a00
+ branch: master
+ specs:
+ arel (3.0.2.20120819075748)
+
+GIT
+ remote: git://github.com/rails/journey.git
+ revision: e64274443f8420df2518cf2206a2c640d9d8e196
+ branch: master
+ specs:
+ journey (2.0.0.20120723141804)
+
+GIT
+ remote: git://github.com/rails/rails.git
+ revision: ffa9540fd361eb34c445568b66abf283b9e658f8
+ branch: master
+ specs:
+ actionmailer (4.0.0.beta)
+ actionpack (= 4.0.0.beta)
+ mail (~> 2.5.3)
+ actionpack (4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ builder (~> 3.1.0)
+ erubis (~> 2.7.0)
+ rack (~> 1.4.3)
+ rack-test (~> 0.6.1)
+ activemodel (4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ builder (~> 3.1.0)
+ activerecord (4.0.0.beta)
+ activemodel (= 4.0.0.beta)
+ activerecord-deprecated_finders (= 0.0.1)
+ activesupport (= 4.0.0.beta)
+ arel (~> 3.0.2)
+ activesupport (4.0.0.beta)
+ i18n (~> 0.6)
+ minitest (~> 4.1)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.33)
+ rails (4.0.0.beta)
+ actionmailer (= 4.0.0.beta)
+ actionpack (= 4.0.0.beta)
+ activerecord (= 4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ bundler (>= 1.3.0.pre.4, < 2.0)
+ railties (= 4.0.0.beta)
+ sprockets-rails (~> 2.0.0.rc1)
+ railties (4.0.0.beta)
+ actionpack (= 4.0.0.beta)
+ activesupport (= 4.0.0.beta)
+ rake (>= 0.8.7)
+ rdoc (~> 3.4)
+ thor (>= 0.15.4, < 2.0)
+
PATH
remote: .
specs:
masq (0.2.5)
i18n_data
- rails (~> 3.2.0)
+ rails (~> 4.0.0.beta)
ruby-openid
ruby-yadis
yubikey
@@ -11,36 +68,10 @@ PATH
GEM
remote: http://rubygems.org/
specs:
- actionmailer (3.2.11)
- actionpack (= 3.2.11)
- mail (~> 2.4.4)
- actionpack (3.2.11)
- activemodel (= 3.2.11)
- activesupport (= 3.2.11)
- builder (~> 3.0.0)
- erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.0)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.11)
- activesupport (= 3.2.11)
- builder (~> 3.0.0)
- activerecord (3.2.11)
- activemodel (= 3.2.11)
- activesupport (= 3.2.11)
- arel (~> 3.0.2)
- tzinfo (~> 0.3.29)
- activeresource (3.2.11)
- activemodel (= 3.2.11)
- activesupport (= 3.2.11)
- activesupport (3.2.11)
- i18n (~> 0.6)
- multi_json (~> 1.0)
+ activerecord-deprecated_finders (0.0.1)
ansi (1.4.3)
- arel (3.0.2)
- builder (3.0.4)
+ atomic (1.0.1)
+ builder (3.1.4)
crypt19 (1.2.1)
erubis (2.7.0)
guard (1.3.2)
@@ -50,57 +81,43 @@ GEM
guard (>= 0.4)
hike (1.2.1)
i18n (0.6.1)
- i18n_data (0.3.2)
- journey (1.0.4)
+ i18n_data (0.3.3)
json (1.7.6)
listen (0.5.0)
- mail (2.4.4)
+ mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
metaclass (0.0.1)
mime-types (1.19)
- minitest (3.4.0)
- mocha (0.12.4)
+ minitest (4.4.0)
+ mocha (0.13.1)
metaclass (~> 0.0.1)
multi_json (1.5.0)
polyglot (0.3.3)
rack (1.4.3)
- rack-cache (1.2)
- rack (>= 0.4)
- rack-ssl (1.3.2)
- rack
rack-test (0.6.2)
rack (>= 1.0)
- rails (3.2.11)
- actionmailer (= 3.2.11)
- actionpack (= 3.2.11)
- activerecord (= 3.2.11)
- activeresource (= 3.2.11)
- activesupport (= 3.2.11)
- bundler (~> 1.0)
- railties (= 3.2.11)
- railties (3.2.11)
- actionpack (= 3.2.11)
- activesupport (= 3.2.11)
- rack-ssl (~> 1.3.2)
- rake (>= 0.8.7)
- rdoc (~> 3.4)
- thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rb-fsevent (0.9.1)
rdoc (3.12)
json (~> 1.4)
- ruby-openid (2.2.0)
+ ruby-openid (2.2.2)
ruby-yadis (0.3.4)
ruby_gntp (0.3.4)
- sprockets (2.2.2)
+ sprockets (2.8.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
+ sprockets-rails (2.0.0.rc1)
+ actionpack (>= 3.0)
+ activesupport (>= 3.0)
+ sprockets (~> 2.8)
sqlite3 (1.3.6)
thor (0.16.0)
+ thread_safe (0.1.0)
+ atomic
tilt (1.3.3)
treetop (1.4.12)
polyglot
@@ -115,10 +132,13 @@ PLATFORMS
ruby
DEPENDENCIES
+ arel!
guard-minitest
+ journey!
masq!
minitest
mocha
+ rails!
rb-fsevent
ruby_gntp
sqlite3
View
17 app/controllers/masq/accounts_controller.rb
@@ -22,9 +22,8 @@ def new
def create
cookies.delete :auth_token
- attrs = params[:account]
- attrs[:login] = attrs[:email] if email_as_login?
- signup = Signup.create_account!(attrs)
+ account_params[:login] = account_params[:email] if email_as_login?
+ signup = Signup.create_account!(account_params)
if signup.succeeded?
redirect_to login_path, :notice => signup.send_activation_email? ?
t(:thanks_for_signing_up_activation_link) :
@@ -36,11 +35,10 @@ def create
end
def update
- attrs = params[:account]
- attrs.delete(:email) if email_as_login?
- attrs.delete(:login)
+ account_params.delete(:email) if email_as_login?
+ account_params.delete(:login)
- if current_account.update_attributes(attrs)
+ if current_account.update_attributes(account_params)
redirect_to edit_account_path(:account => current_account), :notice => t(:profile_updated)
else
render :action => 'edit'
@@ -120,5 +118,10 @@ def detect_xrds
params[:account] = $1
end
end
+
+ def account_params
+ @account_params ||= params.require(:account).permit(:login, :email, :password, :password_confirmation, :public_persona_id, :yubikey_mandatory)
+ end
+
end
end
View
13 app/controllers/masq/personas_controller.rb
@@ -13,6 +13,11 @@ def index
end
end
+ def new
+ @persona = current_account.personas.new
+ end
+
+
def create
respond_to do |format|
if persona.save!
@@ -26,7 +31,7 @@ def create
def update
respond_to do |format|
- if persona.update_attributes(params[:persona])
+ if persona.update_attributes(persona_params)
flash[:notice] = t(:persona_updated)
format.html { redirect_back_or_default account_personas_path }
else
@@ -51,9 +56,13 @@ def destroy
def persona
@persona ||= params[:id].present? ?
current_account.personas.find(params[:id]) :
- current_account.personas.new(params[:persona])
+ current_account.personas.new(persona_params)
end
+ def persona_params
+ params.require(:persona).permit(:title)
+ end
+
def redirect_back_or_default(default)
case session[:return_to]
when decide_path then redirect_to decide_path(:persona_id => persona.id)
View
20 app/controllers/masq/server_controller.rb
@@ -62,8 +62,8 @@ def proceed
# Displays the decision page on that the user can confirm the request and
# choose which data should be transfered to the relying party.
def decide
- @site = current_account.sites.find_or_initialize_by_url(checkid_request.trust_root)
- @site.persona = current_account.personas.find(params[:persona_id] || :first) if sreg_request || ax_store_request || ax_fetch_request
+ @site = current_account.sites.find_or_initialize_by(url: checkid_request.trust_root)
+ @site.persona = current_account.personas.where(params[:persona_id] ).first || current_account.personas.first if sreg_request || ax_store_request || ax_fetch_request
end
# This action is called by submitting the decision form, the information entered by
@@ -75,13 +75,13 @@ def complete
else
resp = checkid_request.answer(true, nil, identifier(current_account))
if params[:always]
- @site = current_account.sites.find_or_create_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
- @site.update_attributes(params[:site])
+ @site = current_account.sites.where(persona_id: params[:site][:persona_id], url: params[:site][:url]).first_or_create
+ @site.update_attributes(site_params)
elsif sreg_request || ax_fetch_request
- @site = current_account.sites.find_or_initialize_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
- @site.attributes = params[:site]
+ @site = current_account.sites.where(persona_id: params[:site][:persona_id], url: params[:site][:url]).first_or_create
+ @site.attributes = site_params
elsif ax_store_request
- @site = current_account.sites.find_or_initialize_by_persona_id_and_url(params[:site][:persona_id], params[:site][:url])
+ @site = current_account.sites.where(persona_id: params[:site][:persona_id], url: params[:site][:url]).first_or_create
not_supported, not_accepted, accepted = [], [], []
ax_store_request.data.each do |type_uri, values|
if property = Persona.attribute_name_for_type_uri(type_uri)
@@ -228,5 +228,11 @@ def auth_policies
[OpenID::PAPE::AUTH_MULTI_FACTOR, OpenID::PAPE::AUTH_PHISHING_RESISTANT] :
[]
end
+
+ def site_params
+ authorized_params = params.require(:site).permit( :persona_id , :url )
+ additional_data = params[:site].slice(:ax_fetch, :sreg, :properties)
+ authorized_params.merge(additional_data)
+ end
end
end
View
6 app/controllers/masq/sites_controller.rb
@@ -19,7 +19,7 @@ def edit
def update
respond_to do |format|
- if site.update_attributes(params[:site])
+ if site.update_attributes(site_params)
flash[:notice] = t(:release_policy_for_site_updated)
format.html { redirect_to edit_account_site_path(site) }
else
@@ -49,5 +49,9 @@ def persona
def find_personas
@personas = current_account.personas.order(:title)
end
+
+ def site_params
+ params.require(:site).permit!
+ end
end
end
View
8 app/models/masq/account.rb
@@ -2,17 +2,17 @@
module Masq
class Account < ActiveRecord::Base
- has_many :personas, :dependent => :delete_all, :order => 'id ASC'
+ has_many :personas, ->(){order(:id)}, :dependent => :delete_all
has_many :sites, :dependent => :destroy
belongs_to :public_persona, :class_name => "Persona"
validates_presence_of :login
validates_length_of :login, :within => 3..254
validates_uniqueness_of :login, :case_sensitive => false
- validates_format_of :login, :with => /^[A-Za-z0-9_@.-]+$/
+ validates_format_of :login, :with => /\A[A-Za-z0-9_@.-]+\z/
validates_presence_of :email
validates_uniqueness_of :email, :case_sensitive => false
- validates_format_of :email, :with => /(^([^@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$)|(^$)/i
+ validates_format_of :email, :with => /(\A([^@\s]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})\z)/i, :allow_blank => true
validates_presence_of :password, :if => :password_required?
validates_presence_of :password_confirmation, :if => :password_required?
validates_length_of :password, :within => 6..40, :if => :password_required?
@@ -23,7 +23,7 @@ class Account < ActiveRecord::Base
before_save :encrypt_password
after_save :deliver_forgot_password
- attr_accessible :login, :email, :password, :password_confirmation, :public_persona_id, :yubikey_mandatory
+ #attr_accessible :login, :email, :password, :password_confirmation, :public_persona_id, :yubikey_mandatory
attr_accessor :password
class ActivationCodeNotFound < StandardError; end
View
2  app/models/masq/open_id_request.rb
@@ -4,7 +4,7 @@ class OpenIdRequest < ActiveRecord::Base
before_validation :make_token, :on => :create
- attr_accessible :parameters
+ #attr_accessible :parameters
serialize :parameters, Hash
def parameters=(params)
View
2  app/models/masq/persona.rb
@@ -9,7 +9,7 @@ class Persona < ActiveRecord::Base
before_destroy :check_deletable!
- attr_protected :account_id, :deletable
+ #attr_protected :account_id, :deletable
class NotDeletable < StandardError; end
View
2  app/models/masq/release_policy.rb
@@ -6,6 +6,6 @@ class ReleasePolicy < ActiveRecord::Base
validates_presence_of :property
validates_uniqueness_of :property, :scope => [:site_id, :type_identifier]
- attr_accessible :property, :type_identifier
+ #attr_accessible :property, :type_identifier
end
end
View
2  app/models/masq/site.rb
@@ -6,7 +6,7 @@ class Site < ActiveRecord::Base
validates_presence_of :url, :persona, :account
validates_uniqueness_of :url, :scope => :account_id
- attr_accessible :url, :persona_id, :properties, :ax_fetch, :sreg
+ #attr_accessible :url, :persona_id, :properties, :ax_fetch, :sreg
# Sets the release policies by first deleting the old ones and
# then appending a new one for every given sreg and ax property.
View
2  app/views/masq/personas/index.html.erb
@@ -8,7 +8,7 @@
<h3><%=h persona.title%></h3>
<div class="options">
<%= link_to t(:edit), edit_account_persona_path(persona) %>
- <%= link_to t(:delete), account_persona_path(persona), :confirm => t(:really_want_to_delete_persona, :title => h(persona.title)), :method => :delete %>
+ <%= link_to t(:delete), account_persona_path(persona), :data => { :confirm => t(:really_want_to_delete_persona, :title => h(persona.title))}, :method => :delete %>
</div>
</li>
<% end %>
View
41 app/views/masq/server/decide.html.erb
@@ -4,10 +4,25 @@
<p><%= t(:trust_root_sends_some_personal_data, :trust_root => "<strong>#{h checkid_request.trust_root}</strong>").html_safe %><br />
<% if @site.persona %>
<%= t(:select_information_to_accept) %></p>
-<p class="note"><%= t(:attributes_will_be_added_to_persona, :persona => "<strong>#{h @site.persona.title}</strong>",
- :choose_link => link_to_function(t(:choose_other_persona), 'Element.toggle("persona_select")')).html_safe %></p>
+<p class="note">
+ <%= t( :attributes_will_be_added_to_persona,
+ :persona => "<strong>#{h @site.persona.title}</strong>",
+ :choose_link => link_to(
+ t(:choose_other_persona),
+ '#',
+ :onclick => 'Element.toggle("persona_select"); return false;'
+ )
+ ).html_safe %>
+</p>
<% else %>
-<p><%= t(:identity_request_missing_persona, :create_link => link_to(t(:create_persona_link), new_account_persona_path(:return => decide_path))).html_safe %></p>
+<p>
+ <%= t( :identity_request_missing_persona,
+ :create_link => link_to(
+ t(:create_persona_link),
+ new_account_persona_path(:return => decide_path)
+ )
+ ).html_safe %>
+</p>
<% end %>
<% elsif sreg_request || ax_fetch_request %>
@@ -15,9 +30,23 @@
<% if @site.persona %>
<%= t(:select_information_to_submit) %></p>
<p class="note"><%= t(:attributes_are_shown_from_persona, :persona => "<strong>#{h @site.persona.title}</strong>").html_safe %><br />
-<%= t(:to_submit_other_values_you_can_edit_or_choose,
- :edit_link => link_to(t(:edit_persona_link), edit_account_persona_path(@site.persona, :return => decide_path(:persona_id => @site.persona.id))),
- :choose_link => link_to_function(t(:choose_other_persona), 'Element.toggle("persona_select")')).html_safe %></p>
+ <%=
+ t( :to_submit_other_values_you_can_edit_or_choose,
+ :edit_link => link_to(
+ t(:edit_persona_link),
+ edit_account_persona_path(
+ @site.persona,
+ :return => decide_path(:persona_id => @site.persona.id)
+ )
+ ),
+ :choose_link => link_to(
+ t(:choose_other_persona),
+ '#',
+ :onclick => 'Element.toggle("persona_select"); return false;'
+ )
+ ).html_safe
+ %>
+</p>
<% else %>
<p><%= t(:identity_request_missing_persona, :create_link => link_to(t(:create_persona_link), new_account_persona_path(:return => decide_path))).html_safe %></p>
<% end %>
View
2  app/views/masq/sites/edit.html.erb
@@ -5,7 +5,7 @@
<%= form_for site, :url => account_site_path(site), :method => :put do |f| %>
<div class="row space">
<%= f.label :persona_id, t(:persona_label) %>
- <%= f.select :persona_id, current_account.personas.all.collect { |p| [ p.title, p.id ] } %>
+ <%= f.select :persona_id, current_account.personas.collect { |p| [ p.title, p.id ] } %>
<%= submit_tag t(:choose_persona_submit) %>
</div>
View
2  app/views/masq/sites/index.html.erb
@@ -10,7 +10,7 @@
<h3><%=h extract_host(site.url) %> <span class="note">(<%=h site.persona.title %>)</span></h3>
<div class="options">
<%= link_to t(:edit_link), edit_account_site_path(site) %>
- <%= link_to t(:delete_link), account_site_path(site), :confirm => t(:really_want_to_delete_trust_for_site, :site => h(extract_host(site.url))), :method => :delete %>
+ <%= link_to t(:delete_link), account_site_path(site), :data => { :confirm => t(:really_want_to_delete_trust_for_site, :site => h(extract_host(site.url))) }, :method => :delete %>
</div>
</li>
<% end %>
View
12 config/routes.rb
@@ -22,17 +22,17 @@
get "/logout" => "sessions#destroy", :as => :logout
post '/resend_activation_email/*account' => 'accounts#resend_activation_email', :as => :resend_activation_email
- match "/server" => "server#index", :as => :server
- match "/server/decide" => "server#decide", :as => :decide
- match "/server/proceed" => "server#proceed", :as => :proceed
- match "/server/complete" => "server#complete", :as => :complete
- match "/server/cancel" => "server#cancel", :as => :cancel
+ match "/server" => "server#index", :as => :server, :via => [:get, :post]
+ match "/server/decide" => "server#decide", :as => :decide, :via => [:get, :post]
+ match "/server/proceed" => "server#proceed", :as => :proceed, :via => [:get, :post]
+ match "/server/complete" => "server#complete", :as => :complete, :via => [:get, :post]
+ match "/server/cancel" => "server#cancel", :as => :cancel, :via => [:get, :post]
get "/server/seatbelt/config.:format" => "server#seatbelt_config", :as => :seatbelt_config
get "/server/seatbelt/state.:format" => "server#seatbelt_login_state", :as => :seatbelt_state
get "/consumer" => "consumer#index", :as => :consumer
post "/consumer/start" => "consumer#start", :as => :consumer_start
- match "/consumer/complete" => "consumer#complete", :as => :consumer_complete
+ match "/consumer/complete" => "consumer#complete", :as => :consumer_complete, :via => [:get, :post]
get "/*account" => "accounts#show", :as => :identity
View
2  lib/masq/active_record_openid_store/association.rb
@@ -4,7 +4,7 @@ module Masq
class Association < ActiveRecord::Base
self.table_name = 'masq_open_id_associations'
- attr_accessible :server_url, :handle, :secret, :issued, :lifetime, :assoc_type
+ #attr_accessible :server_url, :handle, :secret, :issued, :lifetime, :assoc_type
def from_record
OpenID::Association.new(handle, secret, issued, lifetime, assoc_type)
View
2  lib/masq/active_record_openid_store/nonce.rb
@@ -2,6 +2,6 @@ module Masq
class Nonce < ActiveRecord::Base
self.table_name = 'masq_open_id_nonces'
- attr_accessible :server_url, :timestamp, :salt
+ #attr_accessible :server_url, :timestamp, :salt
end
end
View
2  masq.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.md"]
s.test_files = Dir["test/**/*"]
- s.add_dependency "rails", "> 3.2.0"
+ s.add_dependency "rails", "~> 4.0.0.beta"
s.add_dependency "ruby-openid"
s.add_dependency "ruby-yadis"
s.add_dependency "yubikey"
View
5 test/dummy/config/application.rb
@@ -40,11 +40,6 @@ class Application < Rails::Application
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-assignment for all models
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
- # parameters by using an attr_accessible or attr_protected declaration.
- config.active_record.whitelist_attributes = true
# Enable the asset pipeline
config.assets.enabled = true
View
25 test/dummy/config/database.yml
@@ -1,25 +1,10 @@
-# SQLite version 3.x
-# gem install sqlite3
-#
-# Ensure the SQLite 3 gem is defined in your Gemfile
-# gem 'sqlite3'
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
+---
test:
adapter: sqlite3
database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
+ username:
+ password:
+ host: localhost
+ encoding: utf8
pool: 5
timeout: 5000
View
6 test/dummy/config/environments/development.rb
@@ -6,8 +6,6 @@
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
@@ -22,8 +20,6 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
@@ -34,4 +30,6 @@
# Expands the lines which load the assets
config.assets.debug = true
+
+ config.eager_load = false
end
View
2  test/dummy/config/environments/production.rb
@@ -64,4 +64,6 @@
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5
+
+ config.eager_load = true
end
View
6 test/dummy/config/environments/test.rb
@@ -11,8 +11,6 @@
config.serve_static_assets = true
config.static_cache_control = "public, max-age=3600"
- # Log error messages when you accidentally call methods on nil
- config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
@@ -29,9 +27,9 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
+ config.eager_load = false
end
View
2  test/dummy/config/initializers/secret_token.rb
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
-Dummy::Application.config.secret_token = '2c8b19ba1ad3c45b3ab0e01c5f8a7ceb2f77b9005e89d1832ca3ca559526e0f1f3e5f9650a88010e9e2407e48f30c15b509327ee2f261e8f394844fcbf7faf82'
+Dummy::Application.config.secret_key_base = '2c8b19ba1ad3c45b3ab0e01c5f8a7ceb2f77b9005e89d1832ca3ca559526e0f1f3e5f9650a88010e9e2407e48f30c15b509327ee2f261e8f394844fcbf7faf82'
View
1  test/functional/masq/accounts_controller_test.rb
@@ -2,7 +2,6 @@
module Masq
class AccountsControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
fixtures :accounts
View
1  test/functional/masq/info_controller_test.rb
@@ -2,7 +2,6 @@
module Masq
class InfoControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
def test_should_set_yadis_header_on_homepage
get :index
View
1  test/functional/masq/passwords_controller_test.rb
@@ -2,7 +2,6 @@
module Masq
class PasswordsControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
fixtures :accounts
View
1  test/functional/masq/personas_controller_test.rb
@@ -2,7 +2,6 @@
module Masq
class PersonasControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
fixtures :accounts, :personas
View
1  test/functional/masq/server_controller_test.rb
@@ -2,7 +2,6 @@
module Masq
class ServerControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
fixtures :accounts, :personas
View
2  test/functional/masq/sessions_controller_test.rb
@@ -2,7 +2,7 @@
module Masq
class SessionsControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
+
fixtures :accounts
View
3  test/functional/masq/sites_controller_test.rb
@@ -2,8 +2,7 @@
module Masq
class SitesControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
-
+
fixtures :accounts, :sites, :personas
def test_should_require_login_for_index
View
2  test/functional/masq/yubikey_associations_controller_test.rb
@@ -2,7 +2,7 @@
module Masq
class YubikeyAssociationsControllerTest < ActionController::TestCase
- include Masq::Engine.routes_url_helpers
+
fixtures :accounts
View
2  test/integration/openid_user_stories_test.rb
@@ -1,7 +1,7 @@
require 'test_helper'
class OpenidUserStoriesTest < ActionDispatch::IntegrationTest
- include Masq::Engine.routes_url_helpers
+ include Masq::Engine.routes.url_helpers
fixtures :all
View
4 test/test_helper.rb
@@ -3,6 +3,7 @@
require File.expand_path("../dummy/config/environment.rb", __FILE__)
require "rails/test_help"
+require 'mocha/setup'
begin
require 'turn/autorun'
@@ -18,6 +19,7 @@
module Masq
class ActionController::TestCase
+ include Masq::Engine.routes.url_helpers
setup do
@routes = Engine.routes
end
@@ -154,3 +156,5 @@ def authorize_as(account)
# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
+
+
Please sign in to comment.
Something went wrong with that request. Please try again.