aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/view_request_spec.rb
blob: cf1e4ca6ceb025ffa0bc64a1ad6d89eae85a2bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "When viewing requests" do

    fixtures [
        :users,
        :public_bodies,
        :public_body_translations,
        :public_body_versions,
        :info_requests,
        :raw_emails,
        :outgoing_messages,
        :incoming_messages,
        :comments,
        :info_request_events,
        :track_things,
    ]

    before(:each) do
        emails = raw_emails.clone
        load_raw_emails_data(emails)
    end

    it "should not make endlessly recursive JSON <link>s" do
        @dog_request = info_requests(:fancy_dog_request)
        get "request/#{@dog_request.url_title}?unfold=1"
        response.body.should_not include("dog?unfold=1.json")
        response.body.should include("dog.json?unfold=1")
    end

end