diff options
author | Brice Sanchez <contact@brice-sanchez.com> | 2016-05-30 00:37:53 -0400 |
---|---|---|
committer | Brice Sanchez <contact@brice-sanchez.com> | 2016-05-30 22:17:42 -0400 |
commit | b0019fd9acdf04292ff402e1b9d8528517ea7a63 (patch) | |
tree | 306fdd3ca18bca2b5fc38cd6916a5653676768ee /spec/features/refinery/blog/admin/posts_spec.rb | |
parent | eafbd3f3992dc735cbe8fe8efc8296a5c1dc2b78 (diff) | |
download | refinerycms-blog-b0019fd9acdf04292ff402e1b9d8528517ea7a63.tar.gz refinerycms-blog-b0019fd9acdf04292ff402e1b9d8528517ea7a63.tar.bz2 refinerycms-blog-b0019fd9acdf04292ff402e1b9d8528517ea7a63.zip |
Fix specs
Diffstat (limited to 'spec/features/refinery/blog/admin/posts_spec.rb')
-rw-r--r-- | spec/features/refinery/blog/admin/posts_spec.rb | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/spec/features/refinery/blog/admin/posts_spec.rb b/spec/features/refinery/blog/admin/posts_spec.rb index 0efbb1d..ffb4b15 100644 --- a/spec/features/refinery/blog/admin/posts_spec.rb +++ b/spec/features/refinery/blog/admin/posts_spec.rb @@ -5,7 +5,7 @@ module Refinery module Blog module Admin describe Post, type: :feature do - refinery_login_with :refinery_user + refinery_login_with_devise :authentication_devise_refinery_superuser let!(:blog_category) do Globalize.with_locale(:en) { FactoryGirl.create(:blog_category) } @@ -58,7 +58,7 @@ module Refinery end it "should belong to me" do - expect(subject.class.first.author).to eq(::Refinery::User.last) + expect(subject.class.first.author).to eq(::Refinery::Blog.user_class.last) end it "should save categories" do @@ -153,7 +153,7 @@ module Refinery end context "with multiple users" do - let!(:other_guy) { FactoryGirl.create(:refinery_user, :username => "Other Guy") } + let!(:other_guy) { FactoryGirl.create(:authentication_devise_refinery_user, :username => "Other Guy") } describe "create blog post with alternate author" do before do @@ -210,13 +210,20 @@ module Refinery end it "shows up in blog page for default locale" do - visit refinery.blog_root_path + visit refinery.blog_admin_root_path expect(page).to have_selector("#post_#{@p.id}") end - it "does not show up in blog page for secondary locale" do - visit refinery.blog_root_path(:locale => :ru) - expect(page).not_to have_selector("#post_#{@p.id}") + it "does show locale for default locale" do + within "#post_#{@p.id}" do + expect(page).to have_css(".locale_icon.en") + end + end + + it "does not show locale for secondary locale" do + within "#post_#{@p.id}" do + expect(page).not_to have_css(".locale_icon.ru") + end end end @@ -259,13 +266,14 @@ module Refinery end end - it "does not show up in blog page for default locale" do - visit refinery.blog_root_path - expect(page).not_to have_selector("#post_#{@p.id}") + it "does show locale for secondary locale" do + within "#post_#{@p.id}" do + expect(page).to have_css(".locale_icon.ru") + end end it "shows up in blog page for secondary locale" do - visit refinery.blog_root_path(:locale => :ru) + visit refinery.blog_admin_root_path(:locale => :ru) expect(page).to have_selector("#post_#{@p.id}") end |