Skip to content

Commit

Permalink
have spec factories use new UI if ENV['CANVAS_FORCE_USE_NEW_STYLES']
Browse files Browse the repository at this point in the history
closes: CNVS-23137

We have a new jenkins build "canvas-sel-r21-hourly-p2-new-styles"
that will will test everything against new UI. It sets the
CANVAS_FORCE_USE_NEW_STYLES environment variable which, with
this commit will make it so account factories have new_ui
turned on by default. Tests can still explicitly turn off new UI
so they can test something with it turned on and then off if they want.

Change-Id: I8f7384064aa6674c09abc02d712a048a726f76d9
Reviewed-on: https://gerrit.instructure.com/61888
Tested-by: Jenkins
Reviewed-by: Jacob Fugal <[email protected]>
QA-Review: August Thornton <[email protected]>
Product-Review: Derek Hansen <[email protected]>
  • Loading branch information
ryankshaw committed Sep 28, 2015
1 parent 48e3f47 commit 6f4d7ba
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/factories/account_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@

def account_model(opts={})
@account = factory_with_protected_attributes(Account, valid_account_attributes.merge(opts))

# have New UI turned on by default on the canvas-sel-r21-hourly-p2-new-styles jenkins build
@account.enable_feature!(:use_new_styles) if ENV['CANVAS_FORCE_USE_NEW_STYLES']
@account
end

def valid_account_attributes
Expand All @@ -29,6 +33,10 @@ def valid_account_attributes
def account_with_cas(opts={})
@account = opts[:account]
@account ||= Account.create!

# have New UI turned on by default on the canvas-sel-r21-hourly-p2-new-styles jenkins build
@account.enable_feature!(:use_new_styles) if ENV['CANVAS_FORCE_USE_NEW_STYLES']

config = AccountAuthorizationConfig::CAS.new
cas_url = opts[:cas_url] || "https://localhost/cas"
config.auth_type = "cas"
Expand All @@ -42,6 +50,10 @@ def account_with_cas(opts={})
def account_with_saml(opts={})
@account = opts[:account]
@account ||= Account.create!

# have New UI turned on by default on the canvas-sel-r21-hourly-p2-new-styles jenkins build
@account.enable_feature!(:use_new_styles) if ENV['CANVAS_FORCE_USE_NEW_STYLES']

config = AccountAuthorizationConfig::SAML.new
config.idp_entity_id = "saml_entity"
config.auth_type = "saml"
Expand Down

0 comments on commit 6f4d7ba

Please sign in to comment.