aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2011-12-14 15:47:22 -0800
committerPhilip Arndt <parndt@gmail.com>2011-12-14 15:47:22 -0800
commitcc316ceb5bdc6d00ab9fc7dfa4172a6504c06dde (patch)
tree63c6b654e48a88b5abaa93f63e7ca9dff7508d1c /spec
parent3a7a9198a45a6f97866160cd862f44edd72bcba3 (diff)
parent04b49b2371c555363c25081564f02890dc85fa3b (diff)
downloadrefinerycms-blog-cc316ceb5bdc6d00ab9fc7dfa4172a6504c06dde.tar.gz
refinerycms-blog-cc316ceb5bdc6d00ab9fc7dfa4172a6504c06dde.tar.bz2
refinerycms-blog-cc316ceb5bdc6d00ab9fc7dfa4172a6504c06dde.zip
Merge pull request #157 from substantial/add_author_attribution
Add author attribution
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