Rename some directives and internal login details

This commit is contained in:
Rohan Mitchell
2013-10-19 09:45:38 +11:00
parent f7c431be3c
commit b8320a9bb6
5 changed files with 14 additions and 14 deletions

View File

@@ -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)
)

View File

@@ -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 }}

View File

@@ -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

View File

@@ -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'

View File

@@ -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