diff --git a/Gemfile b/Gemfile
index 530bdd38..947584a4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -54,6 +54,7 @@ gem 'simply_stored', github: 'bterkuile/simply_stored'
gem 'devise', github: 'plataformatec/devise', branch: 'lm-rails-4-2' #, '3.1.0' #, '2.0.4'
gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored'
gem "omniauth-facebook"
+gem "omniauth-instagram"
#gem 'simple_form'
gem 'active_decorator' #, path: '/Users/bterkuile/companytools/development/rails/components/active_decorator'
#gem 'cmtool', github: 'bterkuile/cmtool'
diff --git a/Gemfile.lock b/Gemfile.lock
index 16139774..05cbe3c8 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -115,7 +115,7 @@ GEM
sass (~> 3.3)
thor
builder (3.2.2)
- capistrano (3.3.4)
+ capistrano (3.3.5)
capistrano-stats (~> 1.1.0)
i18n
rake (>= 10.0.0)
@@ -129,7 +129,7 @@ GEM
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
- capistrano-stats (1.1.0)
+ capistrano-stats (1.1.1)
capybara (2.4.4)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -156,7 +156,7 @@ GEM
execjs
coffee-script-source (1.8.0)
colored (1.2)
- colorize (0.7.4)
+ colorize (0.7.5)
cookiejar (0.3.2)
couchrest (1.2.0)
mime-types (~> 1.15)
@@ -177,7 +177,7 @@ GEM
activemodel
ember-data-source (1.0.0.beta.12)
ember-source
- ember-rails (0.15.0)
+ ember-rails (0.15.1)
active_model_serializers
barber (>= 0.4.1)
ember-data-source (>= 1.0.0.beta.5)
@@ -198,7 +198,7 @@ GEM
ember-rails (>= 0.14.0)
emblem-source (0.3.17)
erubis (2.7.0)
- eventmachine (1.0.3)
+ eventmachine (1.0.4)
execjs (2.2.2)
factory_girl (4.5.0)
activesupport (>= 3.0.0)
@@ -215,14 +215,14 @@ GEM
multi_json (>= 1.0.0)
rack (>= 1.0.0)
websocket-driver (>= 0.3.0)
- faye-websocket (0.8.0)
+ faye-websocket (0.9.2)
eventmachine (>= 0.12.0)
- websocket-driver (>= 0.4.0)
+ websocket-driver (>= 0.5.1)
font-awesome-rails (4.2.0.0)
railties (>= 3.2, < 5.0)
- foundation-rails (5.4.5.0)
+ foundation-rails (5.5.0.0)
railties (>= 3.1.0)
- sass (>= 3.2.0)
+ sass (>= 3.2.0, < 3.4)
fuubar (2.0.0)
rspec (~> 3.0)
ruby-progressbar (~> 1.4)
@@ -234,11 +234,11 @@ GEM
hashie (3.3.2)
hike (1.2.3)
http_parser.rb (0.6.0)
- i18n (0.7.0.beta1)
+ i18n (0.7.0)
iso_country_codes (0.6.1)
- jquery-rails (4.0.0)
+ jquery-rails (4.0.1)
rails-dom-testing (~> 1.0)
- railties (>= 4.2.0.beta, < 5.0)
+ railties (>= 4.2.0.beta)
thor (>= 0.14, < 2.0)
jquery-ui-rails (5.0.3)
railties (>= 3.2.16)
@@ -262,7 +262,7 @@ GEM
mime-types (1.25.1)
mini_magick (4.0.1)
mini_portile (0.6.1)
- minitest (5.4.3)
+ minitest (5.5.0)
multi_json (1.10.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
@@ -282,6 +282,9 @@ GEM
rack (~> 1.0)
omniauth-facebook (2.0.0)
omniauth-oauth2 (~> 1.2)
+ omniauth-instagram (1.0.1)
+ omniauth (~> 1.0)
+ omniauth-oauth2 (~> 1.0)
omniauth-oauth2 (1.2.0)
faraday (>= 0.8, < 0.10)
multi_json (~> 1.3)
@@ -301,8 +304,8 @@ GEM
pry (>= 0.9.10)
quiet_assets (1.0.3)
railties (>= 3.1, < 5.0)
- rack (1.6.0.beta2)
- rack-cors (0.2.9)
+ rack (1.6.0)
+ rack-cors (0.3.0)
rack-test (0.6.2)
rack (>= 1.0)
rails (4.2.0.rc2)
@@ -361,8 +364,8 @@ GEM
rspec-mocks (~> 3.1.0)
rspec-support (~> 3.1.0)
rspec-support (3.1.2)
- ruby-progressbar (1.7.0)
- sass (3.4.9)
+ ruby-progressbar (1.7.1)
+ sass (3.3.14)
sass-rails (5.0.0.beta1)
railties (>= 4.0.0, < 5.0)
sass (~> 3.2)
@@ -373,17 +376,18 @@ GEM
multi_json (~> 1.0)
simplecov-html (~> 0.8.0)
simplecov-html (0.8.0)
- slim (2.1.0)
- temple (~> 0.6.9)
+ slim (3.0.0)
+ temple (~> 0.7.3)
tilt (>= 1.3.3, < 2.1)
- slim-rails (2.1.5)
+ slim-rails (3.0.0)
+ actionmailer (>= 3.0, < 4.2)
actionpack (>= 3.0, < 4.2)
activesupport (>= 3.0, < 4.2)
railties (>= 3.0, < 4.2)
- slim (~> 2.0)
+ slim (~> 3.0)
slop (3.6.0)
spring (1.2.0)
- spring-commands-rspec (1.0.3)
+ spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (2.12.3)
hike (~> 1.2)
@@ -394,11 +398,11 @@ GEM
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (>= 2.8, < 4.0)
- sshkit (1.5.1)
- colorize
+ sshkit (1.6.1)
+ colorize (>= 0.7.0)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
- temple (0.6.10)
+ temple (0.7.3)
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
@@ -419,7 +423,9 @@ GEM
binding_of_caller (>= 0.7.2)
railties (~> 4.0)
sprockets-rails (>= 2.0, < 4.0)
- websocket-driver (0.4.0)
+ websocket-driver (0.5.1)
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.1)
xpath (2.0.0)
nokogiri (~> 1.3)
@@ -459,6 +465,7 @@ DEPENDENCIES
letter_opener
mini_magick
omniauth-facebook
+ omniauth-instagram
paperclip
pry-rails
quiet_assets
diff --git a/app/assets/javascripts/supplier/app/models/user.js.coffee b/app/assets/javascripts/supplier/app/models/user.js.coffee
index 828a69f2..c43e475f 100644
--- a/app/assets/javascripts/supplier/app/models/user.js.coffee
+++ b/app/assets/javascripts/supplier/app/models/user.js.coffee
@@ -1,14 +1,13 @@
attr = DS.attr
App.User= DS.Model.extend
- facebook_id: attr('string')
- email: attr('string')
name: attr('string')
+ uid: attr('string')
+ provider: attr('string')
+ avatar: attr('string')
list: DS.belongsTo('list') # in ember scope not many to many (yet)
join_requests: DS.hasMany('join_request')
- facebook_image_tag: (->
- facebook_id = @get('facebook_id')
- return '' unless facebook_id
- url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
+ avatar_tag: (->
+ return unless avatar = @get('avatar')
name = @get('name')
- new Handlebars.SafeString "
"
- ).property('facebook_id', 'name')
+ "
".htmlSafe()
+ ).property('avatar', 'name')
diff --git a/app/assets/javascripts/supplier/app/templates/_list_content.emblem b/app/assets/javascripts/supplier/app/templates/_list_content.emblem
index 56cde200..5f98672a 100644
--- a/app/assets/javascripts/supplier/app/templates/_list_content.emblem
+++ b/app/assets/javascripts/supplier/app/templates/_list_content.emblem
@@ -14,7 +14,7 @@ if list.closed_at
.display-field= view "close-list-button" content=list
.user-info-container
each user in list.users
- =user.facebook_image_tag
+ =user.avatar_tag
if list.sorted_orders
.list-orders-container
each order in list.sorted_orders
diff --git a/app/assets/javascripts/supplier/app/templates/active_list.emblem b/app/assets/javascripts/supplier/app/templates/active_list.emblem
index 528529b6..a1aac808 100644
--- a/app/assets/javascripts/supplier/app/templates/active_list.emblem
+++ b/app/assets/javascripts/supplier/app/templates/active_list.emblem
@@ -1,6 +1,6 @@
td.user-info.show-for-large-up
each user in view.content.users
- = user.facebook_image_tag
+ = user.avatar_tag
td.status-icons
if view.content.needs_help
span.icon.needs-help
diff --git a/app/assets/javascripts/supplier/app/templates/active_order.emblem b/app/assets/javascripts/supplier/app/templates/active_order.emblem
index 69306040..2096e4be 100644
--- a/app/assets/javascripts/supplier/app/templates/active_order.emblem
+++ b/app/assets/javascripts/supplier/app/templates/active_order.emblem
@@ -1,6 +1,6 @@
td.user-info.show-for-large-up
each user in view.content.list.users
- = user.facebook_image_tag
+ = user.avatar_tag
td.status-icons
if view.content.active
span.active-order.fa.fa-check.fa-lg
diff --git a/app/assets/javascripts/supplier/app/templates/orders_display.emblem b/app/assets/javascripts/supplier/app/templates/orders_display.emblem
index 2c6398ae..9d08a10d 100644
--- a/app/assets/javascripts/supplier/app/templates/orders_display.emblem
+++ b/app/assets/javascripts/supplier/app/templates/orders_display.emblem
@@ -14,7 +14,7 @@ table.table
tr
td
each user in order.list.users
- = user.facebook_image_tag
+ = user.avatar_tag
td.status-icons
if order.active
span.active-order.fa.fa-check.fa-lg
diff --git a/app/assets/javascripts/supplier/app/templates/section_table.emblem b/app/assets/javascripts/supplier/app/templates/section_table.emblem
index efeddde4..13f2ddb0 100644
--- a/app/assets/javascripts/supplier/app/templates/section_table.emblem
+++ b/app/assets/javascripts/supplier/app/templates/section_table.emblem
@@ -18,7 +18,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
- = user.facebook_image_tag
+ = user.avatar_tag
if editmodedisabled
.table-settings
select
diff --git a/app/assets/javascripts/user/app/app.js.coffee b/app/assets/javascripts/user/app/app.js.coffee
index 1431a02f..94ed6d11 100644
--- a/app/assets/javascripts/user/app/app.js.coffee
+++ b/app/assets/javascripts/user/app/app.js.coffee
@@ -1,12 +1,3 @@
-#FB.init appId: '168928633304849'
-
-#Ember.Application.initializer
- #name: 'authentication',
- #initialize: (container, application)->
- ## register the Facebook authenticator so the session can find it
- #container.register 'authenticators:facebook', App.FacebookAuthenticator
- #Ember.SimpleAuth.setup(container, application)
-
@App = Ember.Application.create
LOG_TRANSITIONS: true
rootElement: '#ember-app-container'
diff --git a/app/assets/javascripts/user/app/models/user.js.coffee.erb b/app/assets/javascripts/user/app/models/user.js.coffee.erb
index 6e08c791..3d8447b7 100644
--- a/app/assets/javascripts/user/app/models/user.js.coffee.erb
+++ b/app/assets/javascripts/user/app/models/user.js.coffee.erb
@@ -1,18 +1,13 @@
attr = DS.attr
App.User = DS.Model.extend
- facebook_id: attr('string')
- email: attr('string')
name: attr('string')
+ uid: attr('string')
+ provider: attr('string')
+ avatar: attr('string')
list: DS.belongsTo('list') # in ember scope not many to many (yet)
join_requests: DS.hasMany('join_request')
- facebook_image_tag: (->
- facebook_id = @get('facebook_id')
- return '' unless facebook_id
-<% if Rails.env.test? %>
- url = ""
-<% else %>
- url = "http://graph.facebook.com/#{facebook_id}/picture?type=square"
-<% end %>
+ avatar_tag: (->
+ return unless avatar = @get('avatar')
name = @get('name')
- new Handlebars.SafeString "
"
- ).property('facebook_id', 'name')
+ "
".htmlSafe()
+ ).property('avatar', 'name')
diff --git a/app/assets/javascripts/user/app/templates/_list_content.emblem b/app/assets/javascripts/user/app/templates/_list_content.emblem
index 9499df56..ce0a9071 100644
--- a/app/assets/javascripts/user/app/templates/_list_content.emblem
+++ b/app/assets/javascripts/user/app/templates/_list_content.emblem
@@ -1,5 +1,5 @@
each user in list.users
- img.facebook-image src="http://graph.facebook.com/#{unbound user.facebook_id}/picture?type=square" alt="f"
+ user.avatar_tag
.display-row
.display-label=t 'attributes.list.created_at'
.display-field=time list.created_at
diff --git a/app/assets/javascripts/user/app/templates/join_requests.emblem b/app/assets/javascripts/user/app/templates/join_requests.emblem
index 0126658d..3b1d5f6a 100644
--- a/app/assets/javascripts/user/app/templates/join_requests.emblem
+++ b/app/assets/javascripts/user/app/templates/join_requests.emblem
@@ -2,8 +2,8 @@
h2= t 'join_request.existing_user.title'
each join_request in join_requests
.join-request-container
- = join_request.user.facebook_image_tag
- span.user-email= join_request.user.email
+ = join_request.user.avatar_tag
+ span.user-name= join_request.user.name
.right
button.join-request-reject{action "rejectRequest" join_request}=t 'join_request.existing_user.reject_request'
button.join-request-approve{action "approveRequest" join_request}=t 'join_request.existing_user.approve_request'
diff --git a/app/assets/stylesheets/supplier/foundation1/_foundation_and_overrides.css.sass b/app/assets/stylesheets/supplier/foundation1/_foundation_and_overrides.css.sass
index 1bc63125..ddaf5f54 100644
--- a/app/assets/stylesheets/supplier/foundation1/_foundation_and_overrides.css.sass
+++ b/app/assets/stylesheets/supplier/foundation1/_foundation_and_overrides.css.sass
@@ -66,7 +66,8 @@
$primary-color: #008349
// $secondary-color: #e7e7e7;
$secondary-color: #d7d7d7
-// $alert-color: #f04124;
+//$alert-color: #f04124;
+$alert-color: #ee3e41
// $success-color: #43AC6A;
// $warning-color: #f08a24;
// $info-color: #a0d3e8;
diff --git a/app/assets/stylesheets/supplier/foundation1/_qconstants.css.sass b/app/assets/stylesheets/supplier/foundation1/_qconstants.css.sass
index 1a3502fa..9274a867 100644
--- a/app/assets/stylesheets/supplier/foundation1/_qconstants.css.sass
+++ b/app/assets/stylesheets/supplier/foundation1/_qconstants.css.sass
@@ -1,7 +1,5 @@
//$qbrown: #634227
$qbrown: #853d15
$qbrown-active: lighten($qbrown, 20%)
-$green: #7BB459 //Heineken
-//$wood: image-url('textures/wood001-vertical.jpg')
$wood: image-url('textures/theme1.jpg')
$background-brown: #57351f
diff --git a/app/assets/stylesheets/supplier/foundation1/components/_menu_main.css.sass b/app/assets/stylesheets/supplier/foundation1/components/_menu_main.css.sass
index 68fa9d5f..027dac2c 100644
--- a/app/assets/stylesheets/supplier/foundation1/components/_menu_main.css.sass
+++ b/app/assets/stylesheets/supplier/foundation1/components/_menu_main.css.sass
@@ -4,7 +4,7 @@ header.top-menu
background-repeat: no-repeat, no-repeat
background-position: left bottom, right bottom
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
- color: $green
+ color: $primary-color
padding-left: 48px
padding-right: 52px
.menu-content
diff --git a/app/assets/stylesheets/user/foundation/_qconstants.css.sass b/app/assets/stylesheets/user/foundation/_qconstants.css.sass
index 2434a3d8..92bf7830 100644
--- a/app/assets/stylesheets/user/foundation/_qconstants.css.sass
+++ b/app/assets/stylesheets/user/foundation/_qconstants.css.sass
@@ -1,10 +1,4 @@
-//$qbrown: #634227
-$qbrown: #853d15
-$qbrown-active: lighten($qbrown, 20%)
-$green: #7BB459 //Heineken
-//$wood: image-url('textures/wood001-vertical.jpg')
$wood: image-url('theme1/wall-bg.jpg')
-$background-brown: #57351f
$current-color: #fc3
$active-color: #f70
$top-menu-height: 76px
diff --git a/app/assets/stylesheets/user/foundation/components/_join_requests.css.sass b/app/assets/stylesheets/user/foundation/components/_join_requests.css.sass
index b74f4da5..77734e9b 100644
--- a/app/assets/stylesheets/user/foundation/components/_join_requests.css.sass
+++ b/app/assets/stylesheets/user/foundation/components/_join_requests.css.sass
@@ -1,5 +1,5 @@
.join-request-container
- .user-email
+ .user-name
padding-left: 12px
.join-request-reject
+button($bg: $secondary-color)
diff --git a/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass b/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass
index 1fb8aad9..3dc36f7e 100644
--- a/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass
+++ b/app/assets/stylesheets/user/foundation/components/_menu_main.css.sass
@@ -9,7 +9,7 @@
background-image: image-url('theme1/wall-bg.jpg')
height: $top-menu-height
.top-menu-bar
- color: $green
+ color: $primary-color
height: $top-menu-height
background-image: image-url('theme1/button-bar-left.png'), image-url('theme1/button-bar-right.png')
background-color: transparent
diff --git a/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass b/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass
index 537ef495..c2546ede 100644
--- a/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass
+++ b/app/assets/stylesheets/user/foundation/foundation_and_overrides.css.sass
@@ -59,9 +59,11 @@
// We use these as default colors throughout
// $primary-color: #008CBA;
-$primary-color: green
+// $primary-color: green
+$primary-color: #008349
// $secondary-color: #e7e7e7;
$secondary-color: #d7d7d7
+$alert-color: #ee3e41
// $alert-color: #f04124;
// $success-color: #43AC6A;
// $warning-color: #f08a24;
diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb
index 6f7fb6a0..67496aa4 100644
--- a/app/controllers/users/omniauth_callbacks_controller.rb
+++ b/app/controllers/users/omniauth_callbacks_controller.rb
@@ -7,22 +7,24 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
def facebook
- @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user)
+ @user = User.find_for_oauth(request.env["omniauth.auth"], current_user)
if @user.persisted?
- flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook"
+ flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => @user.provider.to_s.capitalize
sign_in @user
#redirect_to user_root_path, :event => :authentication, :current_user => @user # infinite loop
redirect_to user_obtain_token_path, :event => :authentication, :current_user => @user
else
session["devise.facebook_data"] = request.env["omniauth.auth"]
Rails.logger.error("Failed to persist user: #{@user.errors.full_messages.join(', ')}")
- #TAG: facebook
- # redirect_to new_user_registration_url
redirect_to '/'
end
end
+ def instagram
+ facebook # same same
+ end
+
def failure(env = {})
#binding.pry
show_404
diff --git a/app/models/user.rb b/app/models/user.rb
index 0b718db3..51035670 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -13,7 +13,7 @@ class User
property :oauth_expires_at
property :auth_data
- devise :database_authenticatable, :recoverable, :rememberable, :trackable, :omniauthable, :omniauth_providers => [:facebook] #, :token_authenticatable , :registerable
+ devise :database_authenticatable, :recoverable, :rememberable, :trackable, :omniauthable, :omniauth_providers => [:facebook, :instagram] #, :token_authenticatable , :registerable
property :authentication_token
@@ -28,10 +28,11 @@ class User
view :by_authentication_token, key: :authentication_token
view :by_email, key: :email
- view :by_facebook, key: [:provider, :uid]
+ view :by_facebook, key: [:provider, :uid] #DEPRICATE on successful change to by_provider
+ view :by_provider, key: [:provider, :uid]
- def self.find_for_facebook_oauth(auth_data, user)
- user = database.view(self.by_facebook(key: [auth_data.provider, auth_data.uid], limit: 1)).first
+ def self.find_for_oauth(auth_data, user)
+ user = database.view(self.by_provider(key: [auth_data.provider, auth_data.uid], limit: 1)).first
user || create(
provider: auth_data.provider,
@@ -49,6 +50,24 @@ class User
uid
end
+ def provider_info
+ case provider.to_sym
+ when :facebook then {}
+ when :instagram
+ uri = URI.parse("https://api.instagram.com/v1/users/#{uid}?access_token=#{auth_data['credentials']['token']}")
+ JSON.parse(Net::HTTP.get(uri)) rescue {ok: false, error: 'cannot_parse_response'}
+ else
+ {ok: false, error: 'provider_unknown'}
+ end
+ end
+
+ def avatar
+ case provider.to_sym
+ when :facebook then "http://graph.facebook.com/#{uid}/picture?type=square"
+ when :instagram then auth_data['info'].try(:[], 'image')
+ end
+ end
+
def self.from_omniauth(auth)
#binding.pry
end
diff --git a/app/serializers/supplier_user_serializer.rb b/app/serializers/supplier_user_serializer.rb
index 540f4942..c21e2a7b 100644
--- a/app/serializers/supplier_user_serializer.rb
+++ b/app/serializers/supplier_user_serializer.rb
@@ -1,6 +1,6 @@
class SupplierUserSerializer < Qwaiter::Serializer
self.root = :user
- attributes :email, :facebook_id, :name
+ attributes :email, :provider, :uid, :name, :avatar
def name
object.supplier_name
diff --git a/app/serializers/user_user_serializer.rb b/app/serializers/user_user_serializer.rb
index 582137a4..d7b4ed5c 100644
--- a/app/serializers/user_user_serializer.rb
+++ b/app/serializers/user_user_serializer.rb
@@ -1,6 +1,6 @@
class UserUserSerializer < Qwaiter::Serializer
self.root = :user
- attributes :email, :facebook_id, :name
+ attributes :email, :provider, :uid, :name, :avatar
def name
object.friends_name
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 44e924be..053abba6 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -239,9 +239,11 @@ Devise.setup do |config|
# scope: 'email,user_birthday,publish_stream'
config.omniauth :facebook, "653729178057509", "d4cea86f70803f1b75ed03c506a4d78e",
scope: 'email,user_birthday,publish_stream'
+ config.omniauth :instagram, "cd7bdfbee825499b94fb3783d1bc143b", "6b4f9ecf251c462993a696eebc0189be"
else
config.omniauth :facebook, "168928633304849", "22bc53e1a390c1e62d004195c55fe336",
scope: 'email,user_birthday,publish_stream'
+ config.omniauth :instagram, "81c78b969a7046d6b6b5b5fe3f30929c", "3697c16762ad4f1ca088e829efbaddde"
end
# ==> Warden configuration
diff --git a/spec/acceptance_steps/global_user_steps.rb b/spec/acceptance_steps/global_user_steps.rb
index d64c6b84..e8e46971 100644
--- a/spec/acceptance_steps/global_user_steps.rb
+++ b/spec/acceptance_steps/global_user_steps.rb
@@ -29,7 +29,7 @@ step "the user should be redirected to the archived list path" do
end
step 'there is another user' do
- @other_user ||= create :user
+ @other_user ||= create :user, :other_auth
end
step "the other user clicks the join table button" do
diff --git a/spec/acceptance_steps/users/join_request_steps.rb b/spec/acceptance_steps/users/join_request_steps.rb
index 0fc486c8..09d739f0 100644
--- a/spec/acceptance_steps/users/join_request_steps.rb
+++ b/spec/acceptance_steps/users/join_request_steps.rb
@@ -4,7 +4,7 @@ step "the original user should see a join request message" do
request_title = page.evaluate_script(%|t('join_request.existing_user.title')|)
request_title.should be_present
page.should have_content request_title
- page.should have_content @other_user.email
+ page.should have_content "UOther" # spec/factories/user
end
step "the original user should not see the join request anymore" do
diff --git a/spec/factories/user_factory.rb b/spec/factories/user_factory.rb
index 8d14f246..2503c9b8 100644
--- a/spec/factories/user_factory.rb
+++ b/spec/factories/user_factory.rb
@@ -2,5 +2,19 @@ FactoryGirl.define do
factory :user do
sequence( :email ){|i| "test#{i}@example.com" }
password "secret"
+
+ trait :other_auth do
+ auth_data( {
+ 'info' => {
+ 'nickname' => "UOther",
+ "name" => "USR Other",
+ "first_name" => "Usother"
+ },
+ "credentials" => {
+ "token" => "fbAuthToken234",
+ 'expires' => false
+ }
+ })
+ end
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 8af8b08b..62ee0604 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -56,6 +56,10 @@ class TestCounter < InMemoryQCounter
#end
end
+# No external images in test suite... slow....
+User.send(:define_method, :avatar, ->{})
+
+
if defined?(Couchbase)
class Couchbase::View
alias :old_initialize :initialize
diff --git a/wip.md b/wip.md
index 346e0497..56d14981 100644
--- a/wip.md
+++ b/wip.md
@@ -18,6 +18,8 @@ User
- test met veel producten
- product variants
- remove active orders on list close
+- Explanation page before opening facebook login
+- Add instagram login
Bugs
----
@@ -28,8 +30,9 @@ Bugs
General
-------
-- split off faye server
-- split off counter server
+- split off faye server (really low)
+- split off counter server (really low)
+- Loading pages
Post release
============