aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPete Higgins <pete@peterhiggins.org>2011-12-14 15:01:04 -0800
committerPete Higgins <pete@peterhiggins.org>2011-12-14 15:24:20 -0800
commit04b49b2371c555363c25081564f02890dc85fa3b (patch)
tree63c6b654e48a88b5abaa93f63e7ca9dff7508d1c /spec
parent3a7a9198a45a6f97866160cd862f44edd72bcba3 (diff)
downloadrefinerycms-blog-04b49b2371c555363c25081564f02890dc85fa3b.tar.gz
refinerycms-blog-04b49b2371c555363c25081564f02890dc85fa3b.tar.bz2
refinerycms-blog-04b49b2371c555363c25081564f02890dc85fa3b.zip
Allow configurable author for blog posts.
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/refinery/admin/blog/posts_spec.rb30
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/requests/refinery/admin/blog/posts_spec.rb b/spec/requests/refinery/admin/blog/posts_spec.rb
index 08fbab9..53372b1 100644
--- a/spec/requests/refinery/admin/blog/posts_spec.rb
+++ b/spec/requests/refinery/admin/blog/posts_spec.rb
@@ -48,7 +48,7 @@ module Refinery
end
it "should belong to me" do
- ::Refinery::Blog::Post.first.author.login.should eq(::Refinery::User.last.login)
+ ::Refinery::Blog::Post.first.author.should eq(::Refinery::User.last)
end
it "should save categories" do
@@ -139,5 +139,33 @@ module Refinery
end
end
end
+
+ context "with multiple users" do
+ let!(:other_guy) { Factory(:refinery_user, :username => "Other Guy") }
+
+ describe "create blog post with alternate author" do
+ before(:each) do
+ visit refinery_admin_blog_posts_path
+ click_link "Create new post"
+
+ fill_in "Title", :with => "This is some other guy's blog post"
+ fill_in "blog_post_body", :with => "I totally didn't write it."
+
+ click_link "Advanced Options"
+
+ select other_guy.username, :from => "Author"
+
+ click_button "Save"
+ end
+
+ it "should succeed" do
+ page.should have_content("was successfully added.")
+ end
+
+ it "belongs to another user" do
+ ::Refinery::Blog::Post.last.author.should eq(other_guy)
+ end
+ end
+ end
end
end