adminpanel 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +6 -7
  3. data/Rakefile +8 -7
  4. data/adminpanel.gemspec +6 -6
  5. data/app/controllers/adminpanel/application_controller.rb +1 -0
  6. data/app/controllers/concerns/adminpanel/facebook_actions.rb +1 -1
  7. data/app/controllers/concerns/adminpanel/sitemap_actions.rb +13 -0
  8. data/app/models/concerns/adminpanel/base.rb +1 -2
  9. data/app/models/concerns/adminpanel/facebook.rb +1 -1
  10. data/app/models/concerns/adminpanel/sitemap.rb +34 -0
  11. data/lib/adminpanel/version.rb +1 -1
  12. data/lib/generators/adminpanel/gallery/gallery_generator.rb +26 -28
  13. data/lib/generators/adminpanel/initialize/initialize_generator.rb +50 -52
  14. data/lib/generators/adminpanel/resource/resource_generator.rb +190 -193
  15. data/lib/tasks/adminpanel/adminpanel.rake +4 -4
  16. data/test/dummy/app/controllers/adminpanel/departments_controller.rb +13 -0
  17. data/test/dummy/app/models/adminpanel/department.rb +47 -0
  18. data/test/dummy/app/models/adminpanel/item.rb +38 -0
  19. data/test/dummy/app/models/adminpanel/mug.rb +1 -1
  20. data/test/dummy/app/models/adminpanel/salesman.rb +1 -0
  21. data/test/dummy/config/initializers/adminpanel_setup.rb +1 -0
  22. data/test/dummy/db/schema.rb +12 -0
  23. data/test/dummy/test/fixtures/adminpanel/mugs.yml +12 -0
  24. data/test/dummy/test/fixtures/adminpanel/products.yml +6 -0
  25. data/test/dummy/test/fixtures/adminpanel/salesmen.yml +12 -0
  26. data/test/features/shared/action_exclution_test.rb +20 -0
  27. data/test/features/shared/belongs_to_category_modal_test.rb +35 -0
  28. data/test/features/shared/belongs_to_non_category_modal_test.rb +41 -0
  29. data/test/features/shared/edit_test.rb +32 -0
  30. data/test/features/shared/has_many_through_category_modal_test.rb +35 -0
  31. data/test/features/shared/has_many_through_non_category_modal_test.rb +37 -0
  32. data/test/features/shared/index_test.rb +20 -0
  33. data/test/features/shared/new_test.rb +3 -3
  34. data/test/features/shared/show_test.rb +20 -0
  35. data/test/generators/gallery_generator_test.rb +39 -0
  36. data/test/generators/initialize_generator_test.rb +45 -0
  37. data/test/generators/resource_generator_test.rb +138 -0
  38. data/test/tasks/adminpanel_rake_test.rb +32 -0
  39. data/test/test_helper.rb +16 -23
  40. metadata +81 -70
  41. data/app/uploaders/adminpanel/image_uploader.rb +0 -58
  42. data/spec/features/galleries_pages_spec.rb +0 -110
  43. data/spec/features/section_pages_spec.rb +0 -36
  44. data/spec/features/shared_pages/edit_spec.rb +0 -48
  45. data/spec/features/shared_pages/index_spec.rb +0 -50
  46. data/spec/features/shared_pages/new_spec.rb +0 -128
  47. data/spec/features/shared_pages/show_spec.rb +0 -30
  48. data/spec/generators/gallery_generator_spec.rb +0 -48
  49. data/spec/generators/initialize_generator_spec.rb +0 -68
  50. data/spec/generators/resource_generator_spec.rb +0 -169
  51. data/spec/spec_helper.rb +0 -42
  52. data/spec/support/capybara_matchers.rb +0 -17
  53. data/spec/support/factories.rb +0 -52
  54. data/spec/support/helper_methods.rb +0 -30
  55. data/spec/support/shared_connection.rb +0 -10
  56. data/spec/tasks/adminpanel_rake_spec.rb +0 -59
@@ -1,59 +0,0 @@
1
- require 'spec_helper'
2
-
3
-
4
- describe 'adminpanel rake task' do
5
-
6
- before :all do
7
- Adminpanel::Section.delete_all
8
- Rake.application.rake_require 'tasks/adminpanel/adminpanel'
9
- Rake::Task.define_task(:environment)
10
- end
11
-
12
- describe 'adminpanel:populate[10, product, name:name description:lorem price:small_lorem]' do
13
-
14
- let(:has_nil_attribute) { false }
15
- before do
16
- Rake.application.invoke_task "adminpanel:populate[10, product, name:name description:lorem price:number]"
17
- end
18
-
19
-
20
- # it "should generate 10 product records" do
21
- # Adminpanel::Product.find(:all).count.should eq 10
22
- # end
23
-
24
- it "attributes shouldn't be nil" do
25
- Adminpanel::Product.all.each do |product|
26
- if (product.name.nil? || product.description.nil? || product.price.nil? ||
27
- product.name == "" || product.description == "" || product.price == "")
28
- has_nil_attribute = true
29
- end
30
- end
31
- has_nil_attribute.should eq false
32
- end
33
- end
34
-
35
- describe 'adminpanel:section[mission, about]' do
36
- before do
37
- Rake.application.invoke_task "adminpanel:section[mission, about]"
38
- end
39
-
40
- it "should create a section with name 'mission' and section 'about'" do
41
- (
42
- (Adminpanel::Section.last.name.should eq("Mission")) &&
43
- (Adminpanel::Section.last.page.should eq("about")) &&
44
- (Adminpanel::Section.last.key.should eq("mission")) &&
45
- (Adminpanel::Section.last.has_description.should be_false) &&
46
- (Adminpanel::Section.last.has_image.should be_false)
47
- )
48
- end
49
- end
50
-
51
- describe 'adminpanel:user' do
52
- before do
53
- Rake.application.invoke_task 'adminpanel:user'
54
- end
55
- it 'should create webmaster@codn user' do
56
- Adminpanel::User.last.email.should eq('webmaster@codn.com')
57
- end
58
- end
59
- end