adminpanel 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -7
- data/Rakefile +8 -7
- data/adminpanel.gemspec +6 -6
- data/app/controllers/adminpanel/application_controller.rb +1 -0
- data/app/controllers/concerns/adminpanel/facebook_actions.rb +1 -1
- data/app/controllers/concerns/adminpanel/sitemap_actions.rb +13 -0
- data/app/models/concerns/adminpanel/base.rb +1 -2
- data/app/models/concerns/adminpanel/facebook.rb +1 -1
- data/app/models/concerns/adminpanel/sitemap.rb +34 -0
- data/lib/adminpanel/version.rb +1 -1
- data/lib/generators/adminpanel/gallery/gallery_generator.rb +26 -28
- data/lib/generators/adminpanel/initialize/initialize_generator.rb +50 -52
- data/lib/generators/adminpanel/resource/resource_generator.rb +190 -193
- data/lib/tasks/adminpanel/adminpanel.rake +4 -4
- data/test/dummy/app/controllers/adminpanel/departments_controller.rb +13 -0
- data/test/dummy/app/models/adminpanel/department.rb +47 -0
- data/test/dummy/app/models/adminpanel/item.rb +38 -0
- data/test/dummy/app/models/adminpanel/mug.rb +1 -1
- data/test/dummy/app/models/adminpanel/salesman.rb +1 -0
- data/test/dummy/config/initializers/adminpanel_setup.rb +1 -0
- data/test/dummy/db/schema.rb +12 -0
- data/test/dummy/test/fixtures/adminpanel/mugs.yml +12 -0
- data/test/dummy/test/fixtures/adminpanel/products.yml +6 -0
- data/test/dummy/test/fixtures/adminpanel/salesmen.yml +12 -0
- data/test/features/shared/action_exclution_test.rb +20 -0
- data/test/features/shared/belongs_to_category_modal_test.rb +35 -0
- data/test/features/shared/belongs_to_non_category_modal_test.rb +41 -0
- data/test/features/shared/edit_test.rb +32 -0
- data/test/features/shared/has_many_through_category_modal_test.rb +35 -0
- data/test/features/shared/has_many_through_non_category_modal_test.rb +37 -0
- data/test/features/shared/index_test.rb +20 -0
- data/test/features/shared/new_test.rb +3 -3
- data/test/features/shared/show_test.rb +20 -0
- data/test/generators/gallery_generator_test.rb +39 -0
- data/test/generators/initialize_generator_test.rb +45 -0
- data/test/generators/resource_generator_test.rb +138 -0
- data/test/tasks/adminpanel_rake_test.rb +32 -0
- data/test/test_helper.rb +16 -23
- metadata +81 -70
- data/app/uploaders/adminpanel/image_uploader.rb +0 -58
- data/spec/features/galleries_pages_spec.rb +0 -110
- data/spec/features/section_pages_spec.rb +0 -36
- data/spec/features/shared_pages/edit_spec.rb +0 -48
- data/spec/features/shared_pages/index_spec.rb +0 -50
- data/spec/features/shared_pages/new_spec.rb +0 -128
- data/spec/features/shared_pages/show_spec.rb +0 -30
- data/spec/generators/gallery_generator_spec.rb +0 -48
- data/spec/generators/initialize_generator_spec.rb +0 -68
- data/spec/generators/resource_generator_spec.rb +0 -169
- data/spec/spec_helper.rb +0 -42
- data/spec/support/capybara_matchers.rb +0 -17
- data/spec/support/factories.rb +0 -52
- data/spec/support/helper_methods.rb +0 -30
- data/spec/support/shared_connection.rb +0 -10
- 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
|