From b8320a9bb68438dd8442bf6fe121565f2d231d29 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sat, 19 Oct 2013 09:45:38 +1100 Subject: [PATCH] Rename some directives and internal login details --- app/assets/javascripts/admin/order_cycle.js.erb.coffee | 8 ++++---- .../_exchange_supplied_products_form.html.haml | 4 ++-- app/views/admin/order_cycles/_form.html.haml | 2 +- spec/features/consumer/checkout_spec.rb | 4 ++-- spec/support/request/authentication_workflow.rb | 10 +++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/assets/javascripts/admin/order_cycle.js.erb.coffee b/app/assets/javascripts/admin/order_cycle.js.erb.coffee index be6696af70..e6ae465baf 100644 --- a/app/assets/javascripts/admin/order_cycle.js.erb.coffee +++ b/app/assets/javascripts/admin/order_cycle.js.erb.coffee @@ -354,16 +354,16 @@ angular.module('order_cycle', ['ngResource']) parsed.assign(scope, dateText) ]) - .directive('ofwOnChange', -> + .directive('ofnOnChange', -> (scope, element, attrs) -> element.bind 'change', -> - scope.$apply(attrs.ofwOnChange) + scope.$apply(attrs.ofnOnChange) ) - .directive('ofwSyncDistributions', -> + .directive('ofnSyncDistributions', -> (scope, element, attrs) -> element.bind 'change', -> if !$(this).is(':checked') scope.$apply -> - scope.removeDistributionOfVariant(attrs.ofwSyncDistributions) + scope.removeDistributionOfVariant(attrs.ofnSyncDistributions) ) \ No newline at end of file diff --git a/app/views/admin/order_cycles/_exchange_supplied_products_form.html.haml b/app/views/admin/order_cycles/_exchange_supplied_products_form.html.haml index fa4a1c555b..092dfc6033 100644 --- a/app/views/admin/order_cycles/_exchange_supplied_products_form.html.haml +++ b/app/views/admin/order_cycles/_exchange_supplied_products_form.html.haml @@ -2,9 +2,9 @@ %td{:colspan => 3} .exchange-product{'ng-repeat' => 'product in enterprises[exchange.enterprise_id].supplied_products'} .exchange-product-details - = check_box_tag 'order_cycle_incoming_exchange_{{ $parent.$index }}_variants_{{ product.master_id }}', 1, 1, 'ng-hide' => 'product.variants', 'ng-model' => 'exchange.variants[product.master_id]', 'ofw-sync-distributions' => '{{ product.master_id }}', 'id' => 'order_cycle_incoming_exchange_{{ $parent.$index }}_variants_{{ product.master_id }}' + = check_box_tag 'order_cycle_incoming_exchange_{{ $parent.$index }}_variants_{{ product.master_id }}', 1, 1, 'ng-hide' => 'product.variants', 'ng-model' => 'exchange.variants[product.master_id]', 'ofn-sync-distributions' => '{{ product.master_id }}', 'id' => 'order_cycle_incoming_exchange_{{ $parent.$index }}_variants_{{ product.master_id }}' %img{'ng-src' => '{{ product.image_url }}'} {{ product.name }} .exchange-product-variant{'ng-repeat' => 'variant in product.variants'} - = check_box_tag 'order_cycle_incoming_exchange_{{ $parent.$parent.$index }}_variants_{{ variant.id }}', 1, 1, 'ng-model' => 'exchange.variants[variant.id]', 'ofw-sync-distributions' => '{{ variant.id }}', 'id' => 'order_cycle_incoming_exchange_{{ $parent.$parent.$index }}_variants_{{ variant.id }}' + = check_box_tag 'order_cycle_incoming_exchange_{{ $parent.$parent.$index }}_variants_{{ variant.id }}', 1, 1, 'ng-model' => 'exchange.variants[variant.id]', 'ofn-sync-distributions' => '{{ variant.id }}', 'id' => 'order_cycle_incoming_exchange_{{ $parent.$parent.$index }}_variants_{{ variant.id }}' {{ variant.label }} diff --git a/app/views/admin/order_cycles/_form.html.haml b/app/views/admin/order_cycles/_form.html.haml index 75bc560486..9cc4f21039 100644 --- a/app/views/admin/order_cycles/_form.html.haml +++ b/app/views/admin/order_cycles/_form.html.haml @@ -31,7 +31,7 @@ %h2 Coordinator = f.label :coordinator_id, 'Coordinator' -= f.collection_select :coordinator_id, coordinating_enterprises, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id', 'ofw-on-change' => 'order_cycle.coordinator_fees = []', 'required' => true} += f.collection_select :coordinator_id, coordinating_enterprises, :id, :name, {}, {'ng-model' => 'order_cycle.coordinator_id', 'ofn-on-change' => 'order_cycle.coordinator_fees = []', 'required' => true} = render 'coordinator_fees', f: f diff --git a/spec/features/consumer/checkout_spec.rb b/spec/features/consumer/checkout_spec.rb index 14a834cf19..31dac80149 100644 --- a/spec/features/consumer/checkout_spec.rb +++ b/spec/features/consumer/checkout_spec.rb @@ -420,7 +420,7 @@ feature %q{ login_to_consumer_section - user = Spree::User.find_by_email 'someone@ofw.org' + user = Spree::User.find_by_email 'someone@ofn.org' o = create(:completed_order_with_totals, user: user, bill_address: create(:address, firstname: 'Joe', lastname: 'Luck', address1: '19 Sycamore Lane', city: 'Horse Hill', @@ -444,7 +444,7 @@ feature %q{ # We perform login inline because: # a) It's a common user flow # b) It has been known to trigger errors with spree_last_address - fill_in 'spree_user_email', :with => 'someone@ofw.org' + fill_in 'spree_user_email', :with => 'someone@ofn.org' fill_in 'spree_user_password', :with => 'passw0rd' click_button 'Login' diff --git a/spec/support/request/authentication_workflow.rb b/spec/support/request/authentication_workflow.rb index b519b297c7..65428a60e3 100644 --- a/spec/support/request/authentication_workflow.rb +++ b/spec/support/request/authentication_workflow.rb @@ -2,12 +2,12 @@ module AuthenticationWorkflow def login_to_admin_section admin_role = Spree::Role.find_or_create_by_name!('admin') admin_user = Spree::User.create!({ - :email => 'admin@ofw.org', + :email => 'admin@ofn.org', :password => 'passw0rd', :password_confirmation => 'passw0rd', :remember_me => false, :persistence_token => 'pass', - :login => 'admin@ofw.org'}) + :login => 'admin@ofn.org'}) admin_user.spree_roles << admin_role @@ -34,17 +34,17 @@ module AuthenticationWorkflow user_role = Spree::Role.find_or_create_by_name!('user') user = Spree::User.create!({ - :email => 'someone@ofw.org', + :email => 'someone@ofn.org', :password => 'passw0rd', :password_confirmation => 'passw0rd', :remember_me => false, :persistence_token => 'pass', - :login => 'someone@ofw.org'}) + :login => 'someone@ofn.org'}) user.spree_roles << user_role visit spree.login_path - fill_in 'spree_user_email', :with => 'someone@ofw.org' + fill_in 'spree_user_email', :with => 'someone@ofn.org' fill_in 'spree_user_password', :with => 'passw0rd' click_button 'Login' end