Skip to content

Commit

Permalink
redirection testing (publiclab#809)
Browse files Browse the repository at this point in the history
  • Loading branch information
jywarren authored Sep 9, 2016
1 parent 50852a9 commit 466b54e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/fixtures/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,15 @@ blog:
type: "note"
cached_likes: 0
slug: jeff-<%= Time.now.strftime("%m-%d-%Y") %>-blog-post

redirect:
nid: 14
uid: 2
title: "Blog post alias title"
path: "/notes/jeff/<%= Time.now.strftime("%m-%d-%Y") %>/blog-post-alias-title"
created: <%= Time.now.to_i %>
changed: <%= Time.now.to_i %>
status: 1
type: "redirect|13"
cached_likes: 0
slug: jeff-<%= Time.now.strftime("%m-%d-%Y") %>-blog-post-alias-title
8 changes: 8 additions & 0 deletions test/integration/public_pages_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,13 @@ def setup
assert_response :success
end

test "browse redirected node" do
get node(:redirect).path
assert_response :redirect
assert_redirected_to node(:blog).path
request_via_redirect :get, node(:blog).path
assert_select 'h1', node(:blog).title
end

end

0 comments on commit 466b54e

Please sign in to comment.