aboutsummaryrefslogtreecommitdiffstats
path: root/spec/features/refinery/blog
diff options
context:
space:
mode:
authorPhilip Arndt <p@arndt.io>2013-09-14 10:00:42 +1200
committerPhilip Arndt <p@arndt.io>2013-09-16 04:56:47 +1200
commita8b5bce609089af8795768230c7dd3a9b87cd5e0 (patch)
tree22a2a154da2b48988c9c4e05600e52fa1b884bf1 /spec/features/refinery/blog
parent5ae082d79e554d3449083aa70ef64ef5d677759a (diff)
downloadrefinerycms-blog-a8b5bce609089af8795768230c7dd3a9b87cd5e0.tar.gz
refinerycms-blog-a8b5bce609089af8795768230c7dd3a9b87cd5e0.tar.bz2
refinerycms-blog-a8b5bce609089af8795768230c7dd3a9b87cd5e0.zip
Supported Rails 4 and Refinery 3.0.0.dev
Diffstat (limited to 'spec/features/refinery/blog')
-rw-r--r--spec/features/refinery/blog/admin/posts_spec.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/spec/features/refinery/blog/admin/posts_spec.rb b/spec/features/refinery/blog/admin/posts_spec.rb
index a5d4f62..5dca929 100644
--- a/spec/features/refinery/blog/admin/posts_spec.rb
+++ b/spec/features/refinery/blog/admin/posts_spec.rb
@@ -39,16 +39,18 @@ module Refinery
describe "create blog post", :js => true do
before do
+ subject.class.count.should eq(0)
fill_in "post_title", :with => "This is my blog post"
+
# this is a dirty hack but textarea that needs to be filled is
# hidden and capybara refuses to fill in elements it can't see
page.evaluate_script("WYMeditor.INSTANCES[0].html('<p>And I love it</p>')")
click_link "toggle_advanced_options"
+ page.should have_css '.blog_categories'
+ page.should have_css "#post_category_ids_#{blog_category.id}"
check blog_category.title
+ find_field("post_category_ids_#{blog_category.id}").should be_checked
click_button "Save"
- end
-
- it "should succeed" do
page.should have_content("was successfully added.")
end
@@ -67,13 +69,13 @@ module Refinery
end
describe "create blog post with tags", :js => true do
+ let(:tag_list) { "chicago, bikes, beers, babes" }
before do
- @tag_list = "chicago, bikes, beers, babes"
fill_in "Title", :with => "This is a tagged blog post"
# this is a dirty hack but textarea that needs to be filled is
# hidden and capybara refuses to fill in elements it can't see
page.evaluate_script("WYMeditor.INSTANCES[0].html('<p>And I also love it</p>')")
- fill_in "Tags", :with => @tag_list
+ fill_in "Tags", :with => tag_list
click_button "Save"
end
@@ -86,7 +88,7 @@ module Refinery
end
it "should have the specified tags" do
- subject.class.last.tag_list.sort.should eq(@tag_list.split(', ').sort)
+ subject.class.last.tag_list.sort.should eq(tag_list.split(', ').sort)
end
end
end
@@ -171,9 +173,6 @@ module Refinery
select other_guy.username, :from => "Author"
click_button "Save"
- end
-
- it "should succeed" do
page.should have_content("was successfully added.")
end