shoppe 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/shoppe/application.coffee +1 -1
- data/app/assets/stylesheets/shoppe/application.scss +3 -3
- data/app/controllers/shoppe/application_controller.rb +4 -0
- data/app/controllers/shoppe/delivery_service_prices_controller.rb +1 -1
- data/app/controllers/shoppe/products_controller.rb +1 -1
- data/app/controllers/shoppe/tax_rates_controller.rb +47 -0
- data/app/models/shoppe/country.rb +14 -0
- data/app/models/shoppe/delivery_service_price.rb +1 -1
- data/app/models/shoppe/order.rb +3 -2
- data/app/models/shoppe/order_item.rb +5 -4
- data/app/models/shoppe/product.rb +1 -1
- data/app/models/shoppe/tax_rate.rb +23 -0
- data/app/views/layouts/shoppe/application.html.haml +1 -0
- data/app/views/shoppe/delivery_service_prices/_form.html.haml +2 -2
- data/app/views/shoppe/orders/show.html.haml +1 -1
- data/app/views/shoppe/products/_form.html.haml +2 -2
- data/app/views/shoppe/tax_rates/form.html.haml +22 -0
- data/app/views/shoppe/tax_rates/index.html.haml +17 -0
- data/config/routes.rb +1 -0
- data/db/countries.txt +252 -0
- data/db/migrate/20131017180920_create_shoppe_countries.rb +16 -0
- data/db/migrate/20131017183211_create_shoppe_tax_rates.rb +26 -0
- data/db/seeds.rb +29 -25
- data/lib/shoppe/country_importer.rb +15 -0
- data/lib/shoppe/version.rb +1 -1
- data/lib/tasks/shoppe.rake +12 -0
- data/test/dummy/config/database.yml +12 -11
- data/test/dummy/db/migrate/20131017165217_create_nifty_attachments_table.rb +16 -0
- data/test/dummy/db/migrate/20131017165222_create_nifty_key_value_store_table.rb +14 -0
- data/test/dummy/db/schema.rb +22 -1
- data/test/dummy/log/development.log +45 -0
- data/test/dummy/log/test.log +938 -0
- data/test/models/shoppe/basket_test.rb +1 -1
- data/test/models/shoppe/user_test.rb +11 -21
- data/test/test_helper.rb +5 -1
- metadata +32 -3
@@ -3,34 +3,24 @@ require 'test_helper'
|
|
3
3
|
module Shoppe
|
4
4
|
class UserTest < ActiveSupport::TestCase
|
5
5
|
|
6
|
-
setup do
|
7
|
-
@user = User.first
|
8
|
-
end
|
9
|
-
|
10
6
|
test "authentication" do
|
11
|
-
user = User.
|
12
|
-
|
13
|
-
|
14
|
-
assert_equal
|
7
|
+
user = User.create(:email_address => 'adam@niftyware.io', :password => 'llamafarm', :password_confirmation => 'llamafarm', :first_name => 'Adam', :last_name => 'Cooke')
|
8
|
+
|
9
|
+
authed_user = User.authenticate('adam@niftyware.io', 'llamafarm')
|
10
|
+
assert_equal User, authed_user.class
|
11
|
+
assert_equal user, authed_user
|
12
|
+
authed_user = User.authenticate('adam@niftyware.io', 'invalid')
|
13
|
+
assert_equal false, authed_user
|
15
14
|
end
|
16
15
|
|
17
16
|
test "full name" do
|
18
|
-
|
17
|
+
user = User.new(:first_name => 'Adam', :last_name => 'Cooke')
|
18
|
+
assert_equal "Adam Cooke", user.full_name
|
19
19
|
end
|
20
20
|
|
21
21
|
test "short name" do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
test "user creation" do
|
26
|
-
user = User.new
|
27
|
-
assert_equal false, user.save
|
28
|
-
user.first_name = 'Test'
|
29
|
-
user.last_name = 'User'
|
30
|
-
user.email_address = 'test@example.com'
|
31
|
-
user.password = 'password'
|
32
|
-
user.password_confirmation = 'password'
|
33
|
-
assert_equal true, user.save
|
22
|
+
user = User.new(:first_name => 'Adam', :last_name => 'Cooke')
|
23
|
+
assert_equal "Adam C", user.short_name
|
34
24
|
end
|
35
25
|
|
36
26
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
ENV["RAILS_ENV"] = "test"
|
2
2
|
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
3
3
|
require "rails/test_help"
|
4
|
-
|
4
|
+
|
5
|
+
if Shoppe::Product.all.empty?
|
6
|
+
puts "Loading Shoppe seed data as database seems to be empty..."
|
7
|
+
Shoppe::Engine.load_seed
|
8
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoppe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -235,6 +235,22 @@ dependencies:
|
|
235
235
|
- - ! '>='
|
236
236
|
- !ruby/object:Gem::Version
|
237
237
|
version: '0'
|
238
|
+
- !ruby/object:Gem::Dependency
|
239
|
+
name: mysql2
|
240
|
+
requirement: !ruby/object:Gem::Requirement
|
241
|
+
none: false
|
242
|
+
requirements:
|
243
|
+
- - ! '>='
|
244
|
+
- !ruby/object:Gem::Version
|
245
|
+
version: '0'
|
246
|
+
type: :development
|
247
|
+
prerelease: false
|
248
|
+
version_requirements: !ruby/object:Gem::Requirement
|
249
|
+
none: false
|
250
|
+
requirements:
|
251
|
+
- - ! '>='
|
252
|
+
- !ruby/object:Gem::Version
|
253
|
+
version: '0'
|
238
254
|
description: A full Rails engine providing e-commerce functionality for any Rails
|
239
255
|
4 application.
|
240
256
|
email:
|
@@ -299,11 +315,13 @@ files:
|
|
299
315
|
- app/controllers/shoppe/product_categories_controller.rb
|
300
316
|
- app/controllers/shoppe/products_controller.rb
|
301
317
|
- app/controllers/shoppe/sessions_controller.rb
|
318
|
+
- app/controllers/shoppe/tax_rates_controller.rb
|
302
319
|
- app/controllers/shoppe/users_controller.rb
|
303
320
|
- app/helpers/shoppe/application_helper.rb
|
304
321
|
- app/helpers/shoppe/shoppe_helper.rb
|
305
322
|
- app/mailers/shoppe/order_mailer.rb
|
306
323
|
- app/mailers/shoppe/user_mailer.rb
|
324
|
+
- app/models/shoppe/country.rb
|
307
325
|
- app/models/shoppe/delivery_service.rb
|
308
326
|
- app/models/shoppe/delivery_service_price.rb
|
309
327
|
- app/models/shoppe/order.rb
|
@@ -313,6 +331,7 @@ files:
|
|
313
331
|
- app/models/shoppe/product_attribute.rb
|
314
332
|
- app/models/shoppe/product_category.rb
|
315
333
|
- app/models/shoppe/stock_level_adjustment.rb
|
334
|
+
- app/models/shoppe/tax_rate.rb
|
316
335
|
- app/models/shoppe/user.rb
|
317
336
|
- app/views/layouts/shoppe/application.html.haml
|
318
337
|
- app/views/layouts/shoppe/sub.html.haml
|
@@ -341,6 +360,8 @@ files:
|
|
341
360
|
- app/views/shoppe/products/stock_levels.html.haml
|
342
361
|
- app/views/shoppe/sessions/new.html.haml
|
343
362
|
- app/views/shoppe/sessions/reset.html.haml
|
363
|
+
- app/views/shoppe/tax_rates/form.html.haml
|
364
|
+
- app/views/shoppe/tax_rates/index.html.haml
|
344
365
|
- app/views/shoppe/user_mailer/new_password.text.erb
|
345
366
|
- app/views/shoppe/users/_form.html.haml
|
346
367
|
- app/views/shoppe/users/edit.html.haml
|
@@ -348,12 +369,15 @@ files:
|
|
348
369
|
- app/views/shoppe/users/new.html.haml
|
349
370
|
- config/routes.rb
|
350
371
|
- config/shoppe.example.yml
|
372
|
+
- db/countries.txt
|
351
373
|
- db/migrate/20130926094549_create_shoppe_initial_schema.rb
|
352
374
|
- db/migrate/20131012123829_create_shoppe_product_attributes.rb
|
353
375
|
- db/migrate/20131012163301_add_public_boolean_to_product_attributes.rb
|
354
376
|
- db/migrate/20131013123937_add_cost_prices_to_various_objects.rb
|
355
377
|
- db/migrate/20131013131658_add_stock_control_boolean_to_products.rb
|
356
378
|
- db/migrate/20131017144430_create_shoppe_stock_level_adjustments.rb
|
379
|
+
- db/migrate/20131017180920_create_shoppe_countries.rb
|
380
|
+
- db/migrate/20131017183211_create_shoppe_tax_rates.rb
|
357
381
|
- db/seeds.rb
|
358
382
|
- db/seeds_data/poe400.jpg
|
359
383
|
- db/seeds_data/snom-870-blk.jpg
|
@@ -368,6 +392,7 @@ files:
|
|
368
392
|
- db/seeds_data/t46gn.jpg
|
369
393
|
- db/seeds_data/w52p.jpg
|
370
394
|
- db/seeds_data/yhs32.jpg
|
395
|
+
- lib/shoppe/country_importer.rb
|
371
396
|
- lib/shoppe/engine.rb
|
372
397
|
- lib/shoppe/errors/inappropriate_delivery_service.rb
|
373
398
|
- lib/shoppe/errors/insufficient_stock_to_fulfil.rb
|
@@ -407,6 +432,8 @@ files:
|
|
407
432
|
- test/dummy/config/shoppe.yml
|
408
433
|
- test/dummy/config.ru
|
409
434
|
- test/dummy/db/development.sqlite3
|
435
|
+
- test/dummy/db/migrate/20131017165217_create_nifty_attachments_table.rb
|
436
|
+
- test/dummy/db/migrate/20131017165222_create_nifty_key_value_store_table.rb
|
410
437
|
- test/dummy/db/schema.rb
|
411
438
|
- test/dummy/db/test.sqlite3
|
412
439
|
- test/dummy/log/development.log
|
@@ -435,7 +462,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
435
462
|
version: '0'
|
436
463
|
segments:
|
437
464
|
- 0
|
438
|
-
hash:
|
465
|
+
hash: 2209799675854067542
|
439
466
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
440
467
|
none: false
|
441
468
|
requirements:
|
@@ -444,7 +471,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
471
|
version: '0'
|
445
472
|
segments:
|
446
473
|
- 0
|
447
|
-
hash:
|
474
|
+
hash: 2209799675854067542
|
448
475
|
requirements: []
|
449
476
|
rubyforge_project:
|
450
477
|
rubygems_version: 1.8.23
|
@@ -479,6 +506,8 @@ test_files:
|
|
479
506
|
- test/dummy/config/shoppe.yml
|
480
507
|
- test/dummy/config.ru
|
481
508
|
- test/dummy/db/development.sqlite3
|
509
|
+
- test/dummy/db/migrate/20131017165217_create_nifty_attachments_table.rb
|
510
|
+
- test/dummy/db/migrate/20131017165222_create_nifty_key_value_store_table.rb
|
482
511
|
- test/dummy/db/schema.rb
|
483
512
|
- test/dummy/db/test.sqlite3
|
484
513
|
- test/dummy/log/development.log
|