aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/request_controller_spec.rb8
-rw-r--r--spec/views/public_body/show.rhtml_spec.rb8
2 files changed, 12 insertions, 4 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index caca03d58..51936d0de 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -125,6 +125,14 @@ describe RequestController, "when showing one request" do
response.should have_text(/First hello/)
end
+ it "should generate valid HTML verson of plain text attachments " do
+ ir = info_requests(:fancy_dog_request)
+ receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email)
+ get :get_attachment_as_html, :incoming_message_id => ir.incoming_messages[1].id, :id => ir.id, :part => 2, :file_name => ['hello.txt.html'], :skip_cache => 1
+ response.content_type.should == "text/html"
+ response.should have_text(/Second hello/)
+ end
+
it "should treat attachments with unknown extensions as binary" do
ir = info_requests(:fancy_dog_request)
receive_incoming_mail('incoming-request-attachment-unknown-extension.email', ir.incoming_email)
diff --git a/spec/views/public_body/show.rhtml_spec.rb b/spec/views/public_body/show.rhtml_spec.rb
index 7793b9b38..d52e1ac5e 100644
--- a/spec/views/public_body/show.rhtml_spec.rb
+++ b/spec/views/public_body/show.rhtml_spec.rb
@@ -67,10 +67,10 @@ describe "when viewing a body" do
@pb.stub!(:get_tag_values).and_return(['98765', '12345'])
render "public_body/show"
- response.should have_tag("div#request_sidebar") do
+ response.should have_tag("div#header_right") do
with_tag("a[href*=?]", /charity-commission.gov.uk.*RegisteredCharityNumber=98765$/)
end
- response.should have_tag("div#request_sidebar") do
+ response.should have_tag("div#header_right") do
with_tag("a[href*=?]", /charity-commission.gov.uk.*RegisteredCharityNumber=12345$/)
end
end
@@ -80,7 +80,7 @@ describe "when viewing a body" do
@pb.stub!(:get_tag_values).and_return(['SC1234'])
render "public_body/show"
- response.should have_tag("div#request_sidebar") do
+ response.should have_tag("div#header_right") do
with_tag("a[href*=?]", /www.oscr.org.uk.*id=SC1234$/)
end
end
@@ -88,7 +88,7 @@ describe "when viewing a body" do
it "should not link to Charity Commission site if we don't have number" do
render "public_body/show"
- response.should have_tag("div#request_sidebar") do
+ response.should have_tag("div#header_right") do
without_tag("a[href*=?]", /charity-commission.gov.uk/)
end
end