Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Admin::ResourceController to overcome respond_to weaknesses by…
… choosing HTML format by default.
- Loading branch information
1 parent
9125720
commit 9c8e24b
Showing
5 changed files
with
42 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ core: | |
|
||
=== Edge | ||
|
||
* Jeroen Janssen | ||
* Sean Cribbs | ||
|
||
=== 0.7.0-RC2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | ||
|
||
describe "Proper content negotiation" do | ||
dataset :pages, :users | ||
|
||
before do | ||
Radiant::Config['defaults.page.parts'] = 'body' | ||
login :admin | ||
end | ||
|
||
it 'should use a default html format and navigate to the pages when logged in' do | ||
get '/admin/pages', nil, :accept => "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" | ||
response.should be_showing("/admin/pages") | ||
response.should_not have_text(/Missing\ template/) | ||
end | ||
|
||
it "should allow the user agent to request a different format via the extension" do | ||
get '/admin/pages.xml', nil, :accept => "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*" | ||
response.should have_text(/<\?xml/) | ||
end | ||
|
||
it "should not render html format when requesting via Ajax" do | ||
get "/admin/pages/#{page_id(:home)}/children", {'level' => 0}, "X-Requested-With" => "XMLHttpRequest", :accept => "text/javascript, text/html, application/xml, text/xml, */*" | ||
response.should_not have_text(/Radiant CMS/) | ||
response.should have_tag("tr[id$=#{page_id(:another)}]") | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.