Skip to content

Commit

Permalink
Merge branch 'allow-custom-state-testing' into rails-3-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
crowbot committed Feb 24, 2015
2 parents f7974a3 + 3fec0fe commit 67a9b39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions app/controllers/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@ class RequestController < ApplicationController

@@custom_states_loaded = false
begin
if !Rails.env.test?
require 'customstates'
include RequestControllerCustomStates
@@custom_states_loaded = true
end
require 'customstates'
include RequestControllerCustomStates
@@custom_states_loaded = true
rescue MissingSourceFile, NameError
end

Expand Down
8 changes: 3 additions & 5 deletions app/models/info_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,9 @@ def user_json_for_api

@@custom_states_loaded = false
begin
if !Rails.env.test?
require 'customstates'
include InfoRequestCustomStates
@@custom_states_loaded = true
end
require 'customstates'
include InfoRequestCustomStates
@@custom_states_loaded = true
rescue MissingSourceFile, NameError
end

Expand Down

0 comments on commit 67a9b39

Please sign in to comment.