3 class OldRelationMembersControllerTest < ActionDispatch::IntegrationTest
6 { :path => "/relation/1/history/2/members", :method => :get },
7 { :controller => "old_relation_members", :action => "show", :id => "1", :version => "2" }
11 def test_show_with_members
12 relation = create(:relation, :with_history)
13 create(:old_relation_member, :old_relation => relation.old_relations.first)
15 get old_relation_members_path(relation, 1)
17 assert_response :success
20 def test_show_redacted_to_unauthorized_users
21 relation = create(:relation, :with_history, :version => 2)
22 relation.old_relations.find_by(:version => 1).redact!(create(:redaction))
24 get old_relation_members_path(relation, 1, :params => { :show_redactions => true })
26 assert_response :redirect
29 def test_show_redacted_to_regular_users
30 relation = create(:relation, :with_history, :version => 2)
31 relation.old_relations.find_by(:version => 1).redact!(create(:redaction))
33 session_for(create(:user))
34 get old_relation_members_path(relation, 1, :params => { :show_redactions => true })
36 assert_response :redirect
39 def test_show_not_found
40 get old_relation_members_path(0, 0)
42 assert_response :not_found
46 relation = create(:relation, :with_history)
48 with_settings(:web_timeout => -1) do
49 get old_relation_members_path(relation, 1)
52 assert_response :error