chr 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.coffeescript-style.json +98 -0
  3. data/.hound.yml +16 -0
  4. data/.ruby-style.yml +239 -0
  5. data/.scss-style.yml +145 -0
  6. data/.travis.yml +2 -2
  7. data/README.md +10 -3
  8. data/app/assets/javascripts/chr/chr.coffee +4 -25
  9. data/app/assets/javascripts/chr/chr_router.coffee +2 -14
  10. data/app/assets/javascripts/chr/item.coffee +2 -19
  11. data/app/assets/javascripts/chr/list.coffee +6 -18
  12. data/app/assets/javascripts/chr/list_config.coffee +3 -10
  13. data/app/assets/javascripts/chr/list_pagination.coffee +1 -9
  14. data/app/assets/javascripts/chr/list_reorder.coffee +1 -8
  15. data/app/assets/javascripts/chr/list_search.coffee +2 -10
  16. data/app/assets/javascripts/chr/list_tabs.coffee +42 -0
  17. data/app/assets/javascripts/chr/module-categories.coffee +0 -2
  18. data/app/assets/javascripts/chr/module.coffee +1 -19
  19. data/app/assets/javascripts/chr/utils.coffee +0 -6
  20. data/app/assets/javascripts/chr/view.coffee +37 -36
  21. data/app/assets/javascripts/chr/view_tabs.coffee +19 -8
  22. data/app/assets/javascripts/stores/rest-array.coffee +23 -36
  23. data/app/assets/stylesheets/chr/layout.scss +17 -13
  24. data/app/assets/stylesheets/chr/themes/basic.scss +13 -13
  25. data/lib/chr/version.rb +1 -1
  26. data/templates/character_admin.coffee.erb +1 -1
  27. data/test/integration/article_fullsize_test.rb +5 -5
  28. data/test/integration/article_test.rb +2 -2
  29. data/test/integration/magazine_article_test.rb +5 -5
  30. data/test/integration/restricted_article_test.rb +3 -3
  31. data/test/integration/sport_article_test.rb +2 -2
  32. data/test/rails_app/.gitignore +15 -0
  33. data/test/rails_app/.ruby-version +1 -0
  34. data/test/rails_app/.sample.env +6 -0
  35. data/test/rails_app/Procfile +1 -0
  36. data/test/rails_app/README.md +45 -0
  37. data/test/rails_app/Rakefile +1 -1
  38. data/test/rails_app/app/assets/images/.keep +0 -0
  39. data/test/rails_app/app/assets/javascripts/admin.coffee +82 -102
  40. data/test/rails_app/app/assets/javascripts/application.coffee +2 -0
  41. data/test/rails_app/app/assets/stylesheets/admin.scss +4 -1
  42. data/test/rails_app/app/assets/stylesheets/application.scss +1 -0
  43. data/test/rails_app/app/controllers/admin/base_controller.rb +5 -0
  44. data/test/rails_app/app/controllers/admin/devise_overrides/passwords_controller.rb +9 -0
  45. data/test/rails_app/app/controllers/admin/devise_overrides/sessions_controller.rb +11 -0
  46. data/test/rails_app/app/controllers/concerns/.keep +0 -0
  47. data/test/rails_app/app/helpers/body_class_helper.rb +15 -0
  48. data/test/rails_app/app/mailers/.keep +0 -0
  49. data/test/rails_app/app/models/.keep +0 -0
  50. data/test/rails_app/app/models/article.rb +0 -4
  51. data/test/rails_app/app/models/concerns/.keep +0 -0
  52. data/test/rails_app/app/uploaders/article_image_uploader.rb +0 -4
  53. data/test/rails_app/app/views/admin/devise_overrides/passwords/edit.html.erb +31 -0
  54. data/test/rails_app/app/views/admin/devise_overrides/passwords/new.html.erb +19 -0
  55. data/test/rails_app/app/views/admin/devise_overrides/sessions/new.html.erb +29 -0
  56. data/test/rails_app/app/views/admin/index.html.erb +1 -3
  57. data/test/rails_app/app/views/application/_analytics.html.erb +9 -0
  58. data/test/rails_app/app/views/application/_flashes.html.erb +7 -0
  59. data/test/rails_app/app/views/application/_javascript.html.erb +12 -0
  60. data/test/rails_app/app/views/layouts/admin.html.erb +13 -11
  61. data/test/rails_app/app/views/layouts/application.html.erb +22 -7
  62. data/test/rails_app/bin/rails +3 -2
  63. data/test/rails_app/bin/rake +3 -2
  64. data/test/rails_app/bin/setup +28 -22
  65. data/test/rails_app/bin/spring +6 -6
  66. data/test/rails_app/config/application.rb +12 -1
  67. data/test/rails_app/config/boot.rb +1 -2
  68. data/test/rails_app/config/environments/development.rb +2 -0
  69. data/test/rails_app/config/environments/production.rb +16 -1
  70. data/test/rails_app/config/environments/staging.rb +9 -0
  71. data/test/rails_app/config/environments/test.rb +1 -3
  72. data/test/rails_app/config/initializers/assets.rb +2 -3
  73. data/test/rails_app/config/initializers/carrierwave.rb +23 -4
  74. data/test/rails_app/config/initializers/devise.rb +265 -0
  75. data/test/rails_app/config/initializers/errors.rb +34 -0
  76. data/test/rails_app/config/initializers/json_encoding.rb +1 -0
  77. data/test/rails_app/config/locales/devise.en.yml +62 -0
  78. data/test/rails_app/config/mongoid.yml +131 -8
  79. data/test/rails_app/config/newrelic.yml +34 -0
  80. data/test/rails_app/config/puma.rb +18 -0
  81. data/test/rails_app/config/routes.rb +86 -0
  82. data/test/rails_app/config/secrets.yml +8 -16
  83. data/test/rails_app/config/smtp.rb +9 -0
  84. data/test/rails_app/lib/assets/.keep +0 -0
  85. data/test/rails_app/lib/tasks/.keep +0 -0
  86. data/test/rails_app/lib/tasks/bundler_audit.rake +12 -0
  87. data/test/rails_app/lib/tasks/dev.rake +12 -0
  88. data/test/rails_app/public/404.html +4 -2
  89. data/test/rails_app/public/422.html +4 -2
  90. data/test/rails_app/public/500.html +4 -2
  91. data/test/rails_app/vendor/assets/javascripts/.keep +0 -0
  92. data/test/rails_app/vendor/assets/stylesheets/.keep +0 -0
  93. data/test/support/character_front_end.rb +10 -9
  94. data/test/support/chr/list_pagination.rb +8 -8
  95. data/test/support/chr/list_reorder.rb +4 -1
  96. data/test/support/chr/view.rb +4 -3
  97. data/test/support/stores/rest-array.rb +3 -3
  98. data/test/test_helper.rb +13 -7
  99. metadata +77 -6
  100. data/test/rails_app/app/assets/javascripts/application.js +0 -1
  101. data/test/rails_app/app/assets/stylesheets/application.css +0 -1
@@ -7,7 +7,7 @@ module CharacterViewTest
7
7
  wait_for_ajax
8
8
  # Select Module
9
9
  select_last_module_from_list(list_of_modules)
10
- # Select Item
10
+ # Select Item
11
11
  find("div.item-title", :text => instance_of_class.title).click
12
12
  wait_for_ajax
13
13
  assert page.has_css?("section.view.#{list_of_modules.last}")
@@ -36,7 +36,7 @@ module CharacterViewTest
36
36
  wait_for_ajax
37
37
  # Select Module
38
38
  select_last_module_from_list(list_of_modules)
39
- # Click "+"
39
+ # Click "+"
40
40
  get_path_from_modules_list(list_of_modules)
41
41
  find("a[href='##{@path}/new']").click
42
42
  find('label.input-title input').set("10 ways to lose weight")
@@ -54,6 +54,7 @@ module CharacterViewTest
54
54
  count_of_objects = class_name.count
55
55
  show_form_of_item(list_of_modules, instance_of_class.id)
56
56
  find_link('Delete').click
57
+ page.driver.browser.switch_to.alert.accept
57
58
  wait_for_ajax
58
59
  assert_not page.has_content?(instance_of_class.title)
59
60
  assert_equal count_of_objects - 1, class_name.count
@@ -66,7 +67,7 @@ module CharacterViewTest
66
67
  instance_of_class = FactoryGirl.create(factory_name)
67
68
  show_form_of_item(list_of_modules, instance_of_class.id)
68
69
  get_path_from_modules_list(list_of_modules)
69
- find("a[href='##{@path}']", :text => 'Close').click
70
+ find("a[href='##{@path}'].close").click
70
71
  wait_for_ajax
71
72
  assert_not page.has_css?("section.view.#{list_of_modules.last}")
72
73
  end
@@ -2,7 +2,7 @@ module CharacterRestArrayTest
2
2
 
3
3
  def urlParams(factory_name, class_name, list_of_modules, config)
4
4
  test 'Select Items Only From Scope' do
5
- create_n_objects(20, factory_name)
5
+ create_n_objects(10, factory_name)
6
6
  visit('/admin')
7
7
  wait_for_ajax
8
8
  select_last_module_from_list(list_of_modules)
@@ -16,7 +16,7 @@ module CharacterRestArrayTest
16
16
 
17
17
  def remove_from_scope(factory_name, class_name, list_of_modules, config)
18
18
  test 'Remove From Scope' do
19
- create_n_objects(20, factory_name)
19
+ create_n_objects(10, factory_name)
20
20
  first_element_from_scope = config[:urlParams].first
21
21
  count_elements_in_scope_before = config[:urlParams].count
22
22
  show_form_of_item(list_of_modules, first_element_from_scope.id)
@@ -27,7 +27,7 @@ module CharacterRestArrayTest
27
27
  visit('/admin')
28
28
  select_last_module_from_list(list_of_modules)
29
29
  assert_not page.has_content?('New sports diet')
30
- assert page.has_css?('div.item-title', count: count_elements_in_scope_before-1)
30
+ assert page.has_css?('.item.is-object', count: count_elements_in_scope_before-1)
31
31
  end
32
32
  end
33
33
 
@@ -24,10 +24,14 @@ DatabaseCleaner.clean_with(:truncation)
24
24
  Minitest::Reporters.use! Minitest::Reporters::SpecReporter.new
25
25
 
26
26
  # Capybara
27
- Capybara.default_driver = :webkit
27
+ Capybara.default_driver = :selenium
28
+ # Capybara.default_driver = :webkit
28
29
  Capybara.default_max_wait_time = 10
29
30
  Capybara::Screenshot.prune_strategy = :keep_last_run
30
31
 
32
+ # Capybara.register_driver :selenium_chrome do |app|
33
+ # Capybara::Selenium::Driver.new(app, :browser => :chrome)
34
+ # end
31
35
 
32
36
  class ActiveSupport::TestCase
33
37
  def setup
@@ -39,12 +43,13 @@ class ActiveSupport::TestCase
39
43
  end
40
44
 
41
45
  def wait_for_ajax
42
- Timeout.timeout(Capybara.default_wait_time) do
43
- loop do
44
- active = page.evaluate_script('$.active').to_i
45
- break if active == 0
46
- end
47
- end
46
+ sleep 1
47
+ # Timeout.timeout(Capybara.default_wait_time) do
48
+ # loop do
49
+ # active = page.evaluate_script('$.active').to_i
50
+ # break if active == 0
51
+ # end
52
+ # end
48
53
  end
49
54
 
50
55
  # Add more helper methods to be used by all tests here...
@@ -63,5 +68,6 @@ class ActionDispatch::IntegrationTest
63
68
  Capybara.reset_sessions!
64
69
  Capybara.use_default_driver
65
70
  DatabaseCleaner.clean
71
+ page.driver.quit()
66
72
  end
67
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kravets
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-12-03 00:00:00.000000000 Z
13
+ date: 2015-12-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -304,9 +304,13 @@ extra_rdoc_files:
304
304
  - README.md
305
305
  - LICENSE
306
306
  files:
307
+ - ".coffeescript-style.json"
307
308
  - ".coveralls.yml"
308
309
  - ".gitignore"
310
+ - ".hound.yml"
311
+ - ".ruby-style.yml"
309
312
  - ".ruby-version"
313
+ - ".scss-style.yml"
310
314
  - ".travis.yml"
311
315
  - CONTRIBUTING.md
312
316
  - Gemfile
@@ -322,6 +326,7 @@ files:
322
326
  - app/assets/javascripts/chr/list_pagination.coffee
323
327
  - app/assets/javascripts/chr/list_reorder.coffee
324
328
  - app/assets/javascripts/chr/list_search.coffee
329
+ - app/assets/javascripts/chr/list_tabs.coffee
325
330
  - app/assets/javascripts/chr/module-categories.coffee
326
331
  - app/assets/javascripts/chr/module.coffee
327
332
  - app/assets/javascripts/chr/utils.coffee
@@ -396,18 +401,37 @@ files:
396
401
  - test/integration/magazine_article_test.rb
397
402
  - test/integration/restricted_article_test.rb
398
403
  - test/integration/sport_article_test.rb
404
+ - test/rails_app/.gitignore
405
+ - test/rails_app/.ruby-version
406
+ - test/rails_app/.sample.env
407
+ - test/rails_app/Procfile
408
+ - test/rails_app/README.md
399
409
  - test/rails_app/Rakefile
410
+ - test/rails_app/app/assets/images/.keep
400
411
  - test/rails_app/app/assets/javascripts/admin.coffee
401
- - test/rails_app/app/assets/javascripts/application.js
412
+ - test/rails_app/app/assets/javascripts/application.coffee
402
413
  - test/rails_app/app/assets/stylesheets/admin.scss
403
- - test/rails_app/app/assets/stylesheets/application.css
414
+ - test/rails_app/app/assets/stylesheets/application.scss
404
415
  - test/rails_app/app/controllers/admin/articles_controller.rb
405
416
  - test/rails_app/app/controllers/admin/base_controller.rb
417
+ - test/rails_app/app/controllers/admin/devise_overrides/passwords_controller.rb
418
+ - test/rails_app/app/controllers/admin/devise_overrides/sessions_controller.rb
406
419
  - test/rails_app/app/controllers/application_controller.rb
420
+ - test/rails_app/app/controllers/concerns/.keep
407
421
  - test/rails_app/app/helpers/application_helper.rb
422
+ - test/rails_app/app/helpers/body_class_helper.rb
423
+ - test/rails_app/app/mailers/.keep
424
+ - test/rails_app/app/models/.keep
408
425
  - test/rails_app/app/models/article.rb
426
+ - test/rails_app/app/models/concerns/.keep
409
427
  - test/rails_app/app/uploaders/article_image_uploader.rb
428
+ - test/rails_app/app/views/admin/devise_overrides/passwords/edit.html.erb
429
+ - test/rails_app/app/views/admin/devise_overrides/passwords/new.html.erb
430
+ - test/rails_app/app/views/admin/devise_overrides/sessions/new.html.erb
410
431
  - test/rails_app/app/views/admin/index.html.erb
432
+ - test/rails_app/app/views/application/_analytics.html.erb
433
+ - test/rails_app/app/views/application/_flashes.html.erb
434
+ - test/rails_app/app/views/application/_javascript.html.erb
411
435
  - test/rails_app/app/views/layouts/admin.html.erb
412
436
  - test/rails_app/app/views/layouts/application.html.erb
413
437
  - test/rails_app/bin/bundle
@@ -421,27 +445,41 @@ files:
421
445
  - test/rails_app/config/environment.rb
422
446
  - test/rails_app/config/environments/development.rb
423
447
  - test/rails_app/config/environments/production.rb
448
+ - test/rails_app/config/environments/staging.rb
424
449
  - test/rails_app/config/environments/test.rb
425
450
  - test/rails_app/config/initializers/assets.rb
426
451
  - test/rails_app/config/initializers/backtrace_silencers.rb
427
452
  - test/rails_app/config/initializers/carrierwave.rb
428
453
  - test/rails_app/config/initializers/cookies_serializer.rb
454
+ - test/rails_app/config/initializers/devise.rb
455
+ - test/rails_app/config/initializers/errors.rb
429
456
  - test/rails_app/config/initializers/filter_parameter_logging.rb
430
457
  - test/rails_app/config/initializers/inflections.rb
458
+ - test/rails_app/config/initializers/json_encoding.rb
431
459
  - test/rails_app/config/initializers/mime_types.rb
432
460
  - test/rails_app/config/initializers/session_store.rb
433
461
  - test/rails_app/config/initializers/wrap_parameters.rb
462
+ - test/rails_app/config/locales/devise.en.yml
434
463
  - test/rails_app/config/locales/en.yml
435
464
  - test/rails_app/config/mongoid.yml
465
+ - test/rails_app/config/newrelic.yml
466
+ - test/rails_app/config/puma.rb
436
467
  - test/rails_app/config/routes.rb
437
468
  - test/rails_app/config/secrets.yml
469
+ - test/rails_app/config/smtp.rb
438
470
  - test/rails_app/db/seeds.rb
471
+ - test/rails_app/lib/assets/.keep
472
+ - test/rails_app/lib/tasks/.keep
473
+ - test/rails_app/lib/tasks/bundler_audit.rake
474
+ - test/rails_app/lib/tasks/dev.rake
439
475
  - test/rails_app/log/development.log
440
476
  - test/rails_app/public/404.html
441
477
  - test/rails_app/public/422.html
442
478
  - test/rails_app/public/500.html
443
479
  - test/rails_app/public/favicon.ico
444
480
  - test/rails_app/public/robots.txt
481
+ - test/rails_app/vendor/assets/javascripts/.keep
482
+ - test/rails_app/vendor/assets/stylesheets/.keep
445
483
  - test/support/character_front_end.rb
446
484
  - test/support/chr/item.rb
447
485
  - test/support/chr/list.rb
@@ -484,18 +522,37 @@ test_files:
484
522
  - test/integration/magazine_article_test.rb
485
523
  - test/integration/restricted_article_test.rb
486
524
  - test/integration/sport_article_test.rb
525
+ - test/rails_app/.gitignore
526
+ - test/rails_app/.ruby-version
527
+ - test/rails_app/.sample.env
528
+ - test/rails_app/Procfile
529
+ - test/rails_app/README.md
487
530
  - test/rails_app/Rakefile
531
+ - test/rails_app/app/assets/images/.keep
488
532
  - test/rails_app/app/assets/javascripts/admin.coffee
489
- - test/rails_app/app/assets/javascripts/application.js
533
+ - test/rails_app/app/assets/javascripts/application.coffee
490
534
  - test/rails_app/app/assets/stylesheets/admin.scss
491
- - test/rails_app/app/assets/stylesheets/application.css
535
+ - test/rails_app/app/assets/stylesheets/application.scss
492
536
  - test/rails_app/app/controllers/admin/articles_controller.rb
493
537
  - test/rails_app/app/controllers/admin/base_controller.rb
538
+ - test/rails_app/app/controllers/admin/devise_overrides/passwords_controller.rb
539
+ - test/rails_app/app/controllers/admin/devise_overrides/sessions_controller.rb
494
540
  - test/rails_app/app/controllers/application_controller.rb
541
+ - test/rails_app/app/controllers/concerns/.keep
495
542
  - test/rails_app/app/helpers/application_helper.rb
543
+ - test/rails_app/app/helpers/body_class_helper.rb
544
+ - test/rails_app/app/mailers/.keep
545
+ - test/rails_app/app/models/.keep
496
546
  - test/rails_app/app/models/article.rb
547
+ - test/rails_app/app/models/concerns/.keep
497
548
  - test/rails_app/app/uploaders/article_image_uploader.rb
549
+ - test/rails_app/app/views/admin/devise_overrides/passwords/edit.html.erb
550
+ - test/rails_app/app/views/admin/devise_overrides/passwords/new.html.erb
551
+ - test/rails_app/app/views/admin/devise_overrides/sessions/new.html.erb
498
552
  - test/rails_app/app/views/admin/index.html.erb
553
+ - test/rails_app/app/views/application/_analytics.html.erb
554
+ - test/rails_app/app/views/application/_flashes.html.erb
555
+ - test/rails_app/app/views/application/_javascript.html.erb
499
556
  - test/rails_app/app/views/layouts/admin.html.erb
500
557
  - test/rails_app/app/views/layouts/application.html.erb
501
558
  - test/rails_app/bin/bundle
@@ -509,27 +566,41 @@ test_files:
509
566
  - test/rails_app/config/environment.rb
510
567
  - test/rails_app/config/environments/development.rb
511
568
  - test/rails_app/config/environments/production.rb
569
+ - test/rails_app/config/environments/staging.rb
512
570
  - test/rails_app/config/environments/test.rb
513
571
  - test/rails_app/config/initializers/assets.rb
514
572
  - test/rails_app/config/initializers/backtrace_silencers.rb
515
573
  - test/rails_app/config/initializers/carrierwave.rb
516
574
  - test/rails_app/config/initializers/cookies_serializer.rb
575
+ - test/rails_app/config/initializers/devise.rb
576
+ - test/rails_app/config/initializers/errors.rb
517
577
  - test/rails_app/config/initializers/filter_parameter_logging.rb
518
578
  - test/rails_app/config/initializers/inflections.rb
579
+ - test/rails_app/config/initializers/json_encoding.rb
519
580
  - test/rails_app/config/initializers/mime_types.rb
520
581
  - test/rails_app/config/initializers/session_store.rb
521
582
  - test/rails_app/config/initializers/wrap_parameters.rb
583
+ - test/rails_app/config/locales/devise.en.yml
522
584
  - test/rails_app/config/locales/en.yml
523
585
  - test/rails_app/config/mongoid.yml
586
+ - test/rails_app/config/newrelic.yml
587
+ - test/rails_app/config/puma.rb
524
588
  - test/rails_app/config/routes.rb
525
589
  - test/rails_app/config/secrets.yml
590
+ - test/rails_app/config/smtp.rb
526
591
  - test/rails_app/db/seeds.rb
592
+ - test/rails_app/lib/assets/.keep
593
+ - test/rails_app/lib/tasks/.keep
594
+ - test/rails_app/lib/tasks/bundler_audit.rake
595
+ - test/rails_app/lib/tasks/dev.rake
527
596
  - test/rails_app/log/development.log
528
597
  - test/rails_app/public/404.html
529
598
  - test/rails_app/public/422.html
530
599
  - test/rails_app/public/500.html
531
600
  - test/rails_app/public/favicon.ico
532
601
  - test/rails_app/public/robots.txt
602
+ - test/rails_app/vendor/assets/javascripts/.keep
603
+ - test/rails_app/vendor/assets/stylesheets/.keep
533
604
  - test/support/character_front_end.rb
534
605
  - test/support/chr/item.rb
535
606
  - test/support/chr/list.rb
@@ -1 +0,0 @@
1
- /* Nothing is in here */
@@ -1 +0,0 @@
1
- /* Nothing is in here */