rspec seems to behave now

This commit is contained in:
2014-08-13 16:06:16 +02:00
parent 3fc7030002
commit d6e7c4998f
7 changed files with 10 additions and 25 deletions
@@ -5,9 +5,10 @@ App.User= DS.Model.extend
name: attr('string')
list: DS.belongsTo('list') # in ember scope not many to many (yet)
join_requests: DS.hasMany('join_request')
facebook_image: (-> "http://graph.facebook.com/#{@get('facebook_id')}/picture?type=square").property('facebook_id')
facebook_image_tag: (->
facebook_id = @get('facebook_id')
return '' unless facebook_id
url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
name = @get('name')
url = @get('facebook_image')
new Handlebars.SafeString "<img src=\"#{url}\" alt=\"#{name}\" title=\"#{name}\" >"
).property('facebook_image', 'name')
).property('facebook_id', 'name')
@@ -13,7 +13,7 @@ if table.active_list
/.table-action-row
a{action "editTable" table}: span.fa.fa-lg.fa-wrench
each user in table.active_list.users
img src=user.facebook_image
span= user.facebook_image_tag
if editmodedisabled
.table-settings
select
@@ -3,10 +3,6 @@ root.Qsupplier=
watch_events: ->
faye = new Faye.Client(event_host)
faye.subscribe "/supplier/#{supplier_object.id}", (e)=>
<% if Rails.env.development? %>
console.log "Event: #{e.event}"
console.log e.data
<% end %>
if(e.event == 'new_order')
if App
App.store().pushPayload(e.data)
@@ -19,7 +19,7 @@ module Suppliers
else
@lists = List.for_supplier(current_supplier, page: params[:page], per_page: params[:per_page] || 25)
end
@lists.include_relation(:table)
@lists.include_relation(:table, :users, orders: {product_orders: :product})
render json: @lists, each_serializer: SupplierListSerializer
end
-12
View File
@@ -2,17 +2,5 @@ class OrderSerializer < Qwaiter::Serializer
embed :ids, include: true
attributes :state, :list_id, :section_id, :table_id #, :price
# todo, put this logic in Ember
#def product_orders
#@product_orders ||= object.product_orders.include_relation(:product) .map do |product_order|
#{product_name: product_order.product.name, id: product_order.id, quantity: product_order.quantity, price: product_order.price}
#end
#end
# todo, put this logic in Ember
#def price
#product_orders.inject(0){|sum, po| sum + po[:quantity] * po[:price]}.round(2)
#end
has_many :product_orders
end
@@ -38,7 +38,7 @@ Feature: Supplier section view
Then the section table should not have any active list markings anymore
And the list should be marked as closed
@javascript @broken
@javascript
Scenario: Selecting a specific section limits the result to the lists and orders of those sections
Given there is an active list and order
And I am signed in as supplier
@@ -54,7 +54,7 @@ Feature: Supplier section view
And I should see the order and the new order
@javascript @broken
@javascript
Scenario: Going to edit mode and change section properties
Given there is an active list and order
And there are 2 supplier sections
@@ -67,7 +67,7 @@ Feature: Supplier section view
When I click the supplier section normal mode button
Then the supplier last section properties should be updated to the new values
@javascript @broken
@javascript
Scenario: A new order is created when the view is already loaded
Given there is a confirmed and open supplier
And there is a table in the section
+1 -1
View File
@@ -18,7 +18,7 @@ Dir.glob("spec/acceptance_steps/**/*steps.rb") { |f| load f, true }
I18n.locale =I18n.default_locale
Devise.stretches = 1
Capybara.javascript_driver = :webkit
Capybara.default_wait_time = 4 # ember needs more time than the default of 2
Capybara.default_wait_time = 6 # ember needs more time than the default of 2
#Capybara.javascript_driver = :selenium
module FactoryAttributesFor