refinerycms-blog 2.1.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +9 -23
- data/Gemfile +15 -7
- data/Rakefile +0 -1
- data/app/assets/javascripts/refinery/blog/backend.js +18 -59
- data/app/assets/stylesheets/refinery/blog/backend.css.scss +4 -55
- data/app/assets/stylesheets/refinery/blog/frontend.css.scss +2 -2
- data/app/controllers/refinery/blog/admin/categories_controller.rb +6 -0
- data/app/controllers/refinery/blog/admin/posts_controller.rb +25 -3
- data/app/controllers/refinery/blog/blog_controller.rb +31 -5
- data/app/controllers/refinery/blog/categories_controller.rb +10 -3
- data/app/controllers/refinery/blog/posts_controller.rb +16 -6
- data/app/helpers/refinery/blog/controller_helper.rb +1 -22
- data/app/models/refinery/blog/categorization.rb +0 -1
- data/app/models/refinery/blog/category.rb +3 -6
- data/app/models/refinery/blog/comment.rb +15 -17
- data/app/models/refinery/blog/post.rb +44 -43
- data/app/views/refinery/blog/admin/_submenu.html.erb +1 -3
- data/app/views/refinery/blog/admin/categories/_category.html.erb +14 -5
- data/app/views/refinery/blog/admin/posts/_form.html.erb +13 -6
- data/app/views/refinery/blog/admin/posts/_form_part.html.erb +1 -1
- data/app/views/refinery/blog/admin/posts/_post.html.erb +12 -5
- data/app/views/refinery/blog/admin/posts/_teaser_part.html.erb +1 -1
- data/app/views/refinery/blog/posts/index.html.erb +2 -2
- data/app/views/refinery/blog/shared/_categories.html.erb +3 -3
- data/app/views/refinery/shared/admin/_autocomplete.html.erb +45 -0
- data/bin/rails +5 -0
- data/bin/refinerycms +62 -0
- data/changelog.md +4 -1
- data/config/locales/cs.yml +2 -2
- data/config/locales/en.yml +3 -0
- data/config/locales/fr.yml +6 -4
- data/config/locales/nb.yml +154 -14
- data/config/locales/nl.yml +21 -0
- data/config/locales/pl.yml +2 -2
- data/config/locales/ru.yml +25 -14
- data/config/locales/zh-CN.yml +32 -1
- data/config/locales/zh-TW.yml +160 -0
- data/config/routes.rb +6 -3
- data/db/migrate/20110803223522_create_blog_structure.rb +4 -4
- data/db/migrate/20120531113632_delete_cached_slugs.rb +2 -2
- data/db/migrate/20140622132537_add_missing_unique_indices.acts_as_taggable_on_engine.rb +20 -0
- data/db/migrate/20140622132538_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +15 -0
- data/db/seeds.rb +4 -4
- data/lib/refinery/blog.rb +1 -1
- data/lib/refinery/blog/configuration.rb +1 -1
- data/lib/refinery/blog/engine.rb +8 -3
- data/readme.md +21 -6
- data/refinerycms-blog.gemspec +9 -7
- data/script/rails +1 -3
- data/spec/controllers/refinery/blog/admin/comments_controller_spec.rb +23 -19
- data/spec/controllers/refinery/blog/admin/posts_controller_spec.rb +35 -0
- data/spec/controllers/refinery/blog/posts_controller_spec.rb +3 -3
- data/spec/factories/blog_posts.rb +1 -1
- data/spec/factories/user.rb +27 -0
- data/spec/features/refinery/blog/admin/categories_spec.rb +106 -104
- data/spec/features/refinery/blog/admin/comments_spec.rb +18 -18
- data/spec/features/refinery/blog/admin/menu_spec.rb +14 -8
- data/spec/features/refinery/blog/admin/posts_spec.rb +99 -86
- data/spec/features/refinery/blog/categories_spec.rb +20 -18
- data/spec/features/refinery/blog/posts_spec.rb +128 -124
- data/spec/helpers/refinery/blog/posts_helper_spec.rb +13 -13
- data/spec/lib/refinery/blog/engine_spec.rb +1 -11
- data/spec/models/refinery/blog/category_spec.rb +10 -10
- data/spec/models/refinery/blog/comment_spec.rb +3 -3
- data/spec/models/refinery/blog/post_spec.rb +59 -33
- data/spec/spec_helper.rb +2 -3
- metadata +75 -50
- data/app/assets/images/refinery/blog/icons/add.png +0 -0
- data/app/assets/images/refinery/blog/icons/cog.png +0 -0
- data/app/assets/images/refinery/blog/icons/comment.png +0 -0
- data/app/assets/images/refinery/blog/icons/comment_cross.png +0 -0
- data/app/assets/images/refinery/blog/icons/comment_tick.png +0 -0
- data/app/assets/images/refinery/blog/icons/comments.png +0 -0
- data/app/assets/images/refinery/blog/icons/down.gif +0 -0
- data/app/assets/images/refinery/blog/icons/folder.png +0 -0
- data/app/assets/images/refinery/blog/icons/folder_add.png +0 -0
- data/app/assets/images/refinery/blog/icons/folder_edit.png +0 -0
- data/app/assets/images/refinery/blog/icons/page.png +0 -0
- data/app/assets/images/refinery/blog/icons/page_add.png +0 -0
- data/app/assets/images/refinery/blog/icons/page_copy.png +0 -0
- data/app/assets/images/refinery/blog/icons/up.gif +0 -0
- data/spec/helpers/refinery/blog/controller_helper_spec.rb +0 -27
- data/todo.md +0 -5
data/refinerycms-blog.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinerycms-blog}
|
5
|
-
s.version = %q{
|
5
|
+
s.version = %q{3.0.1}
|
6
6
|
s.description = %q{A really straightforward open source Ruby on Rails blog engine designed for integration with Refinery CMS.}
|
7
7
|
s.summary = %q{Ruby on Rails blogging engine for Refinery CMS.}
|
8
8
|
s.email = %q{info@refinerycms.com}
|
@@ -15,11 +15,13 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
16
16
|
|
17
17
|
# Runtime dependencies
|
18
|
-
s.add_dependency 'refinerycms-core',
|
19
|
-
s.add_dependency 'refinerycms-settings',
|
20
|
-
s.add_dependency 'filters_spam',
|
18
|
+
s.add_dependency 'refinerycms-core', '~> 3.0.0'
|
19
|
+
s.add_dependency 'refinerycms-settings', '~> 3.0.0'
|
20
|
+
s.add_dependency 'filters_spam', '~> 0.2'
|
21
21
|
s.add_dependency 'acts-as-taggable-on'
|
22
|
-
s.add_dependency 'seo_meta',
|
23
|
-
s.add_dependency 'rails_autolink',
|
24
|
-
s.add_dependency 'friendly_id',
|
22
|
+
s.add_dependency 'seo_meta', '~> 2.0.0.rc.1'
|
23
|
+
s.add_dependency 'rails_autolink', '~> 1.1.3'
|
24
|
+
s.add_dependency 'friendly_id', '~> 5.1.0'
|
25
|
+
s.add_dependency 'globalize', ['>= 4.0.0', '< 5.2']
|
26
|
+
s.add_dependency 'jquery-ui-rails', '~> 5.0.0'
|
25
27
|
end
|
data/script/rails
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#!/usr/bin/env ruby
|
3
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
4
2
|
|
5
3
|
ENGINE_PATH = File.expand_path('../..', __FILE__)
|
6
|
-
load File.expand_path('../../spec/dummy/
|
4
|
+
load File.expand_path('../../spec/dummy/bin/rails', __FILE__)
|
@@ -3,21 +3,25 @@ require "spec_helper"
|
|
3
3
|
module Refinery
|
4
4
|
module Blog
|
5
5
|
module Admin
|
6
|
-
describe CommentsController do
|
7
|
-
|
6
|
+
describe CommentsController, type: :controller do
|
7
|
+
refinery_login_with_devise [:refinery, :superuser]
|
8
|
+
|
9
|
+
before do
|
10
|
+
logged_in_user.plugins = logged_in_user.plugins | %w(refinerycms_blog)
|
11
|
+
end
|
8
12
|
|
9
13
|
describe "#index" do
|
10
14
|
let!(:comment) { FactoryGirl.create(:blog_comment) }
|
11
|
-
|
15
|
+
|
12
16
|
it "succeeds" do
|
13
17
|
get :index
|
14
|
-
response.
|
15
|
-
response.
|
18
|
+
expect(response).to be_success
|
19
|
+
expect(response).to render_template(:index)
|
16
20
|
end
|
17
21
|
|
18
22
|
it "assigns unmoderated comments" do
|
19
23
|
get :index
|
20
|
-
assigns(:comments).first.
|
24
|
+
expect(assigns(:comments).first).to eq(comment)
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
@@ -26,13 +30,13 @@ module Refinery
|
|
26
30
|
|
27
31
|
it "succeeds" do
|
28
32
|
get :approved
|
29
|
-
response.
|
30
|
-
response.
|
33
|
+
expect(response).to be_success
|
34
|
+
expect(response).to render_template(:index)
|
31
35
|
end
|
32
36
|
|
33
37
|
it "assigns approved comments" do
|
34
38
|
get :approved
|
35
|
-
assigns(:comments).first.
|
39
|
+
expect(assigns(:comments).first).to eq(comment)
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
@@ -41,27 +45,27 @@ module Refinery
|
|
41
45
|
|
42
46
|
it "redirects on success" do
|
43
47
|
post :approve, :id => comment.id
|
44
|
-
response.
|
48
|
+
expect(response).to be_redirect
|
45
49
|
end
|
46
|
-
|
50
|
+
|
47
51
|
it "approves the comment" do
|
48
52
|
post :approve, :id => comment.id
|
49
|
-
Refinery::Blog::Comment.approved.count.
|
53
|
+
expect(Refinery::Blog::Comment.approved.count).to eq(1)
|
50
54
|
end
|
51
55
|
end
|
52
|
-
|
56
|
+
|
53
57
|
describe "#rejected" do
|
54
58
|
let!(:comment) { FactoryGirl.create(:rejected_comment) }
|
55
59
|
|
56
60
|
it "succeeds" do
|
57
61
|
get :rejected
|
58
|
-
response.
|
59
|
-
response.
|
62
|
+
expect(response).to be_success
|
63
|
+
expect(response).to render_template(:index)
|
60
64
|
end
|
61
65
|
|
62
66
|
it "assigns rejected comments" do
|
63
67
|
get :rejected
|
64
|
-
assigns(:comments).first.
|
68
|
+
expect(assigns(:comments).first).to eq(comment)
|
65
69
|
end
|
66
70
|
end
|
67
71
|
|
@@ -70,12 +74,12 @@ module Refinery
|
|
70
74
|
|
71
75
|
it "redirects on success" do
|
72
76
|
post :reject, :id => comment.id
|
73
|
-
response.
|
77
|
+
expect(response).to be_redirect
|
74
78
|
end
|
75
|
-
|
79
|
+
|
76
80
|
it "rejects the comment" do
|
77
81
|
post :reject, :id => comment.id
|
78
|
-
Refinery::Blog::Comment.rejected.count.
|
82
|
+
expect(Refinery::Blog::Comment.rejected.count).to eq(1)
|
79
83
|
end
|
80
84
|
end
|
81
85
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Refinery
|
4
|
+
module Blog
|
5
|
+
module Admin
|
6
|
+
describe PostsController, type: :controller do
|
7
|
+
refinery_login_with_devise [:refinery, :superuser]
|
8
|
+
|
9
|
+
describe "#delete_translation" do
|
10
|
+
let!(:blog_post) { FactoryGirl.create(:blog_post) }
|
11
|
+
|
12
|
+
before do
|
13
|
+
blog_post.translations.create(:locale => :fr, :title => 'Un titre francais', :body => "La baguette, c'est bon. Mangez-en.")
|
14
|
+
blog_post.translations.create(:locale => :es, :title => 'Un titulo espanol', :body => "Mi casa e su casa.")
|
15
|
+
end
|
16
|
+
|
17
|
+
it "destroys the translation" do
|
18
|
+
post :delete_translation, :id => blog_post.id, :locale_to_delete => :fr
|
19
|
+
expect(blog_post.translations.exists?(:locale => :fr)).to be_falsey
|
20
|
+
end
|
21
|
+
|
22
|
+
it "does not destroy other translations" do
|
23
|
+
post :delete_translation, :id => blog_post.id, :locale_to_delete => :fr
|
24
|
+
expect(blog_post.translations.exists?(:locale => :es)).to be_truthy
|
25
|
+
end
|
26
|
+
|
27
|
+
it "redirects on success" do
|
28
|
+
post :delete_translation, :id => blog_post.id, :locale_to_delete => :fr
|
29
|
+
expect(response).to be_redirect
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
module Refinery
|
4
4
|
module Blog
|
5
|
-
describe PostsController do
|
5
|
+
describe PostsController, type: :controller do
|
6
6
|
before do
|
7
7
|
FactoryGirl.create(:blog_post, :title => "blogpost_one")
|
8
8
|
FactoryGirl.create(:blog_post, :title => "blogpost_two")
|
@@ -11,12 +11,12 @@ module Refinery
|
|
11
11
|
|
12
12
|
it "should not limit rss feed" do
|
13
13
|
get :index, :format => :rss
|
14
|
-
assigns[:posts].size.
|
14
|
+
expect(assigns[:posts].size).to eq(3)
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should limit rss feed" do
|
18
18
|
get :index, :format => :rss, :max_results => 2
|
19
|
-
assigns[:posts].count.
|
19
|
+
expect(assigns[:posts].count).to eq(2)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -4,7 +4,7 @@ FactoryGirl.define do
|
|
4
4
|
body "These are the top ten shopping centers in Chicago. You're going to read a long blog post about them. Come to peace with it."
|
5
5
|
draft false
|
6
6
|
published_at Time.now
|
7
|
-
author { FactoryGirl.create(:
|
7
|
+
author { FactoryGirl.create(:authentication_devise_refinery_user) }
|
8
8
|
|
9
9
|
factory :blog_post_draft do
|
10
10
|
draft true
|
@@ -0,0 +1,27 @@
|
|
1
|
+
FactoryGirl.define do
|
2
|
+
factory :authentication_devise_user, :class => Refinery::Authentication::Devise::User do
|
3
|
+
sequence(:username) { |n| "refinery#{n}" }
|
4
|
+
sequence(:email) { |n| "refinery#{n}@example.com" }
|
5
|
+
password "refinerycms"
|
6
|
+
password_confirmation "refinerycms"
|
7
|
+
end
|
8
|
+
|
9
|
+
factory :authentication_devise_refinery_user, :parent => :authentication_devise_user do
|
10
|
+
roles { [ ::Refinery::Authentication::Devise::Role[:refinery] ] }
|
11
|
+
|
12
|
+
after(:create) do |user|
|
13
|
+
::Refinery::Plugins.registered.each_with_index do |plugin, index|
|
14
|
+
user.plugins.create(:name => plugin.name, :position => index)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
factory :authentication_devise_refinery_superuser, :parent => :authentication_devise_refinery_user do
|
20
|
+
roles {
|
21
|
+
[
|
22
|
+
::Refinery::Authentication::Devise::Role[:refinery],
|
23
|
+
::Refinery::Authentication::Devise::Role[:superuser]
|
24
|
+
]
|
25
|
+
}
|
26
|
+
end
|
27
|
+
end
|
@@ -1,119 +1,121 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
module Refinery
|
5
|
+
module Blog
|
6
|
+
module Admin
|
7
|
+
describe Category, type: :feature do
|
8
|
+
refinery_login_with_devise :authentication_devise_refinery_superuser
|
6
9
|
|
7
|
-
|
10
|
+
let(:title) { "lol" }
|
8
11
|
|
9
|
-
|
10
|
-
|
12
|
+
it "can create categories" do
|
13
|
+
visit refinery.admin_root_path
|
11
14
|
|
12
|
-
|
13
|
-
|
15
|
+
within("nav#menu") { click_link "Blog" }
|
16
|
+
within("nav.multilist") { click_link "Create new category" }
|
14
17
|
|
15
|
-
|
16
|
-
|
18
|
+
fill_in "Title", :with => title
|
19
|
+
click_button "Save"
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
context "with translations" do
|
23
|
-
before do
|
24
|
-
Refinery::I18n.stub(:frontend_locales).and_return([:en, :ru])
|
25
|
-
blog_page = Globalize.with_locale(:en) { FactoryGirl.create(:page, :link_url => "/blog", :title => "Blog") }
|
26
|
-
Globalize.with_locale(:ru) do
|
27
|
-
blog_page.title = 'блог'
|
28
|
-
blog_page.save
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe "add a category with title for default locale" do
|
33
|
-
before do
|
34
|
-
Globalize.locale = :en
|
35
|
-
visit refinery.blog_admin_posts_path
|
36
|
-
click_link "Create new category"
|
37
|
-
fill_in "Title", :with => "Testing Category"
|
38
|
-
click_button "Save"
|
39
|
-
@c = Refinery::Blog::Category.find_by_title("Testing Category")
|
40
|
-
end
|
41
|
-
|
42
|
-
it "suceeds" do
|
43
|
-
page.should have_content("'#{@c.title}' was successfully added.")
|
44
|
-
Refinery::Blog::Category.count.should eq(1)
|
45
|
-
end
|
46
|
-
|
47
|
-
it "shows locale flag for category" do
|
48
|
-
click_link "Manage"
|
49
|
-
within "#category_#{@c.id}" do
|
50
|
-
page.should have_css("img[src='/assets/refinery/icons/flags/en.png']")
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
it "shows up in blog page for default locale" do
|
55
|
-
visit refinery.blog_root_path
|
56
|
-
within "#categories" do
|
57
|
-
page.should have_selector('li')
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
it "does not show up in blog page for secondary locale" do
|
62
|
-
visit refinery.blog_root_path(:locale => :ru)
|
63
|
-
page.should_not have_selector('#categories')
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
68
|
-
describe "add a category with title for secondary locale" do
|
69
|
-
|
70
|
-
let(:ru_category_title) { 'категория' }
|
71
|
-
|
72
|
-
before do
|
73
|
-
visit refinery.blog_admin_posts_path
|
74
|
-
click_link "Create new category"
|
75
|
-
within "#switch_locale_picker" do
|
76
|
-
click_link "Ru"
|
77
|
-
end
|
78
|
-
fill_in "Title", :with => ru_category_title
|
79
|
-
click_button "Save"
|
80
|
-
@c = Refinery::Blog::Category.find_by_title(ru_category_title)
|
81
|
-
end
|
82
|
-
|
83
|
-
it "suceeds" do
|
84
|
-
page.should have_content("'#{@c.title}' was successfully added.")
|
85
|
-
Refinery::Blog::Category.count.should eq(1)
|
86
|
-
end
|
87
|
-
|
88
|
-
it "shows locale flag for category" do
|
89
|
-
click_link "Manage"
|
90
|
-
within "#category_#{@c.id}" do
|
91
|
-
page.should have_css("img[src='/assets/refinery/icons/flags/ru.png']")
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
it "does not show locale flag for primary locale" do
|
96
|
-
click_link "Manage"
|
97
|
-
within "#category_#{@c.id}" do
|
98
|
-
page.should_not have_css("img[src='/assets/refinery/icons/flags/en.png']")
|
21
|
+
category = Refinery::Blog::Category.first
|
22
|
+
expect(category.title).to eq(title)
|
99
23
|
end
|
100
|
-
end
|
101
|
-
|
102
|
-
it "does not shows up in blog page for default locale" do
|
103
|
-
visit refinery.blog_root_path
|
104
|
-
page.should_not have_selector('#categories')
|
105
|
-
end
|
106
24
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
25
|
+
context "with translations" do
|
26
|
+
before do
|
27
|
+
allow(Refinery::I18n).to receive(:frontend_locales).and_return([:en, :ru])
|
28
|
+
blog_page = Globalize.with_locale(:en) { FactoryGirl.create(:page, :link_url => "/blog", :title => "Blog") }
|
29
|
+
Globalize.with_locale(:ru) do
|
30
|
+
blog_page.title = 'блог'
|
31
|
+
blog_page.save
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "add a category with title for default locale" do
|
36
|
+
before do
|
37
|
+
Globalize.locale = :en
|
38
|
+
visit refinery.blog_admin_posts_path
|
39
|
+
click_link "Create new category"
|
40
|
+
fill_in "Title", :with => "Testing Category"
|
41
|
+
expect { click_button "Save" }.to change(Refinery::Blog::Category, :count).by(1)
|
42
|
+
@c = Refinery::Blog::Category.by_title("Testing Category")
|
43
|
+
end
|
44
|
+
|
45
|
+
it "suceeds" do
|
46
|
+
expect(page).to have_content("'#{@c.title}' was successfully added.")
|
47
|
+
expect(Refinery::Blog::Category.count).to eq(1)
|
48
|
+
end
|
49
|
+
|
50
|
+
it "shows locale for category" do
|
51
|
+
click_link "Manage"
|
52
|
+
within "#category_#{@c.id}" do
|
53
|
+
expect(page).to have_css(".locale .en")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it "shows up in blog page for default locale" do
|
58
|
+
visit refinery.blog_root_path
|
59
|
+
within "#categories" do
|
60
|
+
expect(page).to have_selector('li')
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it "does not show up in blog page for secondary locale" do
|
65
|
+
visit refinery.blog_root_path(:locale => :ru)
|
66
|
+
expect(page).not_to have_selector('#categories')
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
describe "add a category with title for secondary locale" do
|
72
|
+
|
73
|
+
let(:ru_category_title) { 'категория' }
|
74
|
+
|
75
|
+
before do
|
76
|
+
visit refinery.blog_admin_posts_path
|
77
|
+
click_link "Create new category"
|
78
|
+
within "#switch_locale_picker" do
|
79
|
+
click_link "RU"
|
80
|
+
end
|
81
|
+
fill_in "Title", :with => ru_category_title
|
82
|
+
expect { click_button "Save" }.to change(Refinery::Blog::Category, :count).by(1)
|
83
|
+
@c = Refinery::Blog::Category.by_title(ru_category_title)
|
84
|
+
end
|
85
|
+
|
86
|
+
it "suceeds" do
|
87
|
+
expect(page).to have_content("'#{@c.title}' was successfully added.")
|
88
|
+
expect(Refinery::Blog::Category.count).to eq(1)
|
89
|
+
end
|
90
|
+
|
91
|
+
it "shows locale for category" do
|
92
|
+
click_link "Manage"
|
93
|
+
within "#category_#{@c.id}" do
|
94
|
+
expect(page).to have_css(".locale .ru")
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
it "does not show locale for primary locale" do
|
99
|
+
click_link "Manage"
|
100
|
+
within "#category_#{@c.id}" do
|
101
|
+
expect(page).not_to have_css(".locale .en")
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
it "does not shows up in blog page for default locale" do
|
106
|
+
visit refinery.blog_root_path
|
107
|
+
expect(page).not_to have_selector('#categories')
|
108
|
+
end
|
109
|
+
|
110
|
+
it "shows up in blog page for secondary locale" do
|
111
|
+
visit refinery.blog_root_path(:locale => :ru)
|
112
|
+
within "#categories" do
|
113
|
+
expect(page).to have_selector('li')
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
111
117
|
end
|
112
118
|
end
|
113
|
-
|
114
|
-
|
115
119
|
end
|
116
|
-
|
117
|
-
|
118
120
|
end
|
119
121
|
end
|