fix bug for closing lists on preloaded view and add acceptance body
This commit is contained in:
@@ -52,12 +52,9 @@ group :development do
|
||||
end
|
||||
|
||||
group :test do
|
||||
gem 'rspec-rails'
|
||||
#gem 'minitest'
|
||||
gem 'steak'
|
||||
gem 'pry'
|
||||
gem 'factory_girl_rails'
|
||||
gem 'selenium-webdriver' #, '2.21.1' # 2.21.2 gives trouble, remove this line when this is solved since this is a dependency of capybara
|
||||
gem 'capybara'
|
||||
end
|
||||
|
||||
# Use unicorn as the app server
|
||||
|
||||
+7
-3
@@ -46,6 +46,7 @@ GEM
|
||||
activesupport (3.2.9)
|
||||
i18n (~> 0.6)
|
||||
multi_json (~> 1.0)
|
||||
addressable (2.3.2)
|
||||
arel (3.0.2)
|
||||
bcrypt-ruby (3.0.1)
|
||||
builder (3.0.4)
|
||||
@@ -123,7 +124,8 @@ GEM
|
||||
actionpack (>= 3.1)
|
||||
less (~> 2.2.0)
|
||||
libv8 (3.3.10.4)
|
||||
libwebsocket (0.1.6.1)
|
||||
libwebsocket (0.1.7.1)
|
||||
addressable
|
||||
websocket
|
||||
mail (2.4.4)
|
||||
i18n (>= 0.4.0)
|
||||
@@ -211,6 +213,9 @@ GEM
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
steak (2.0.0)
|
||||
capybara (>= 1.0.0)
|
||||
rspec-rails (>= 2.5.0)
|
||||
subexec (0.2.2)
|
||||
temple (0.5.5)
|
||||
therubyracer (0.10.2)
|
||||
@@ -242,7 +247,6 @@ PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
capybara
|
||||
coffee-rails (~> 3.2.1)
|
||||
compass-rails
|
||||
couch_potato!
|
||||
@@ -262,9 +266,9 @@ DEPENDENCIES
|
||||
rqrcode
|
||||
rspec-rails
|
||||
sass-rails (~> 3.2.3)
|
||||
selenium-webdriver
|
||||
simply_stored!
|
||||
slim-rails
|
||||
steak
|
||||
therubyracer
|
||||
thin
|
||||
twitter-bootstrap-rails
|
||||
|
||||
@@ -51,6 +51,7 @@ class SupplierController < ApplicationController
|
||||
ho[:table_number] = order.table_number
|
||||
ho[:section_title] = order.list.table.section.try(:title)
|
||||
ho[:id] = order.id
|
||||
ho[:list_id] = order.list_id
|
||||
list_total += ho[:total_amount]
|
||||
h[:orders] << ho
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ html lang="en"
|
||||
- unless ENV['QWAITER_MOBILE_EXPORT'] == 'yes'
|
||||
javascript:
|
||||
#{Rails.env.production? ? '' : "data_host = 'http://qwaiter.dev';"}
|
||||
//var data_host = 'http://localhost:3000';
|
||||
var data_host = 'http://localhost:3000';
|
||||
QMobile || (QMobile = {
|
||||
scanQr: function(){window.location = '/select_qrcode'},
|
||||
activateRotation: function(){},
|
||||
@@ -76,7 +76,7 @@ html lang="en"
|
||||
.span12
|
||||
= yield
|
||||
= javascript_include_tag "user/application"
|
||||
script#alert-template[type="text/html"]= render 'alert.mustache'
|
||||
script#alert-template[type="text/html"]= render 'user/alert.mustache'
|
||||
= yield :footer
|
||||
javascript:
|
||||
jQuery(function(){#{onload_javascript}});
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
# Put your acceptance spec helpers inside spec/acceptance/support
|
||||
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
||||
@@ -0,0 +1,17 @@
|
||||
require 'acceptance/acceptance_helper'
|
||||
|
||||
feature 'Supplier main board spec.rb', %q{
|
||||
In order to manage active orders
|
||||
As a supplier
|
||||
I want to have control
|
||||
} do
|
||||
background do
|
||||
create_supplier 'supplier@qwaiter.com'
|
||||
create_user 'user@qwaiter.com'
|
||||
end
|
||||
|
||||
scenario 'loaded orders should have a list_id present for handling actions' do
|
||||
login_supplier_as 'supplier@qwaiter.com'
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
module HelperMethods
|
||||
# Put helper methods you need to be available in all acceptance specs here.
|
||||
|
||||
def create_user(email, password='secret')
|
||||
@user = User.find_by_email(email) || FactoryGirl.create(:user, email: email, password: password)
|
||||
end
|
||||
def create_supplier(email, password='secret')
|
||||
@supplier = Supplier.find_by_email(email) || FactoryGirl.create(:supplier, email: email, password: password)
|
||||
end
|
||||
|
||||
def login_user_as(email)
|
||||
visit "/users/sign_in"
|
||||
fill_in "user_email", with: email
|
||||
fill_in "user_password", with: "secret"
|
||||
submit_form
|
||||
end
|
||||
|
||||
def login_supplier_as(email)
|
||||
visit "/suppliers/sign_in"
|
||||
fill_in "supplier_email", with: email
|
||||
fill_in "supplier_password", with: "secret"
|
||||
submit_form
|
||||
end
|
||||
|
||||
def submit_form
|
||||
find("[type=submit]").click
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configuration.include HelperMethods, :type => :acceptance
|
||||
@@ -0,0 +1,9 @@
|
||||
module NavigationHelpers
|
||||
# Put helper methods related to the paths in your application here.
|
||||
|
||||
def homepage
|
||||
"/"
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configuration.include NavigationHelpers, :type => :acceptance
|
||||
Reference in New Issue
Block a user