completely green

This commit is contained in:
2014-08-13 16:37:59 +02:00
parent d6e7c4998f
commit a675999d01
6 changed files with 11 additions and 5 deletions
@@ -10,5 +10,5 @@ App.User= DS.Model.extend
return '' unless facebook_id return '' unless facebook_id
url = "http://graph.facebook.com/#{facebook_id}/picture?type=square" url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
name = @get('name') name = @get('name')
new Handlebars.SafeString "<img src=\"#{url}\" alt=\"#{name}\" title=\"#{name}\" >" new Handlebars.SafeString "<img src=\"#{url}\" alt=\"#{name}\" title=\"#{name}\" class=\"user-facebook-image\">"
).property('facebook_id', 'name') ).property('facebook_id', 'name')
@@ -13,7 +13,7 @@ if table.active_list
/.table-action-row /.table-action-row
a{action "editTable" table}: span.fa.fa-lg.fa-wrench a{action "editTable" table}: span.fa.fa-lg.fa-wrench
each user in table.active_list.users each user in table.active_list.users
span= user.facebook_image_tag = user.facebook_image_tag
if editmodedisabled if editmodedisabled
.table-settings .table-settings
select select
@@ -3,6 +3,10 @@ root.Qsupplier=
watch_events: -> watch_events: ->
faye = new Faye.Client(event_host) faye = new Faye.Client(event_host)
faye.subscribe "/supplier/#{supplier_object.id}", (e)=> 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(e.event == 'new_order')
if App if App
App.store().pushPayload(e.data) App.store().pushPayload(e.data)
+1 -1
View File
@@ -21,7 +21,7 @@
Qstorage = window.localStorage; Qstorage = window.localStorage;
Qstorage.setItem('auth_token', '#{current_user.authentication_token}'); Qstorage.setItem('auth_token', '#{current_user.authentication_token}');
Qstorage.setItem('user_id', '#{current_user.id}'); Qstorage.setItem('user_id', '#{current_user.id}');
window.location = (Qstorage.getItem('root_url') || '/index.html') + '?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}'; window.location = (Qstorage.getItem('root_url') || '/user/index.html') + '?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}';
// localStorage.setItem('auth_token', '#{current_user.authentication_token}'); // localStorage.setItem('auth_token', '#{current_user.authentication_token}');
// localStorage.setItem('user_id', '#{current_user.id}'); // localStorage.setItem('user_id', '#{current_user.id}');
// window.location = $root_url + '?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}'; // window.location = $root_url + '?user_id=#{current_user.id}&auth_token=#{current_user.authentication_token}';
@@ -6,8 +6,8 @@ Feature: Sign up as user using facebook
Given There is no user information stored in the local storage Given There is no user information stored in the local storage
When I visit the user obtain token path When I visit the user obtain token path
Then I should be signed in as a user through facebook Then I should be signed in as a user through facebook
And I wait 4 seconds When I wait 4 seconds
And I should be redirected to the user home Then I should be redirected to the user home
And the newly created user info should be stored in the local storage And the newly created user info should be stored in the local storage
@javascript @javascript
@@ -1,5 +1,7 @@
step "There is no user information stored in the local storage" do step "There is no user information stored in the local storage" do
visit '/'
page.execute_script %|Qstorage = window.localStorage|
page.evaluate_script(%|Qstorage.getItem('user_id')|).should be_blank page.evaluate_script(%|Qstorage.getItem('user_id')|).should be_blank
page.evaluate_script(%|Qstorage.getItem('auth_token')|).should be_blank page.evaluate_script(%|Qstorage.getItem('auth_token')|).should be_blank
end end