Commit 78ea2c82 authored by Jonne Haß's avatar Jonne Haß

Merge pull request #5878 from Flaburgan/chrome-frame

Fix the IE version number extractor to work without space between MSIE and the version number
parents 59e8fc93 2b2c39ee
......@@ -14,6 +14,7 @@
* Fix medium and small avatar URLs when using Camo [#5883](https://github.com/diaspora/diaspora/pull/5883)
* Improve output of script/server [#5885](https://github.com/diaspora/diaspora/pull/5885)
* Fix CSS for bold links [#5887](https://github.com/diaspora/diaspora/pull/5887)
* Correctly handle IE8 in the chrome frame middleware [#5878](https://github.com/diaspora/diaspora/pull/5878)
## Features
* Hide post title of limited post in comment notification email [#5843](https://github.com/diaspora/diaspora/pull/5843)
......
......@@ -65,7 +65,7 @@ module Rack
end
def ie_version(ua_string)
ua_string.match(/MSIE (\S+)/)[1].to_f
ua_string.match(/MSIE ?(\S+)/)[1].to_f
end
end
end
......@@ -18,7 +18,7 @@ describe Rack::ChromeFrame do
context "non-IE browser" do
let(:ua_string) { "another browser chromeframe" }
it "shouldn't complain about the browser" do
it "shouldn't complain about the browser and shouldn't have chrome frame" do
expect(subject.body).not_to match(/chrome=1/)
expect(subject.body).not_to match(/Diaspora doesn't support your version of Internet Explorer/)
end
......@@ -27,7 +27,7 @@ describe Rack::ChromeFrame do
context "IE8 without chromeframe" do
let(:ua_string) { "MSIE 8" }
it "shouldn't complain about the browser" do
it "shouldn't complain about the browser and shouldn't have chrome frame" do
expect(subject.body).not_to match(/chrome=1/)
expect(subject.body).not_to match(/Diaspora doesn't support your version of Internet Explorer/)
end
......@@ -36,7 +36,7 @@ describe Rack::ChromeFrame do
context "IE7 without chromeframe" do
let(:ua_string) { "MSIE 7" }
it "shouldn't complain about the browser" do
it "should complain about the browser" do
expect(subject.body).not_to match(/chrome=1/)
expect(subject.body).to match(/Diaspora doesn't support your version of Internet Explorer/)
end
......@@ -46,10 +46,18 @@ describe Rack::ChromeFrame do
context "any IE with chromeframe" do
let(:ua_string) { "MSIE number chromeframe" }
it "shouldn't complain about the browser" do
it "shouldn't complain about the browser and should have chrome frame" do
expect(subject.body).to match(/chrome=1/)
expect(subject.body).not_to match(/Diaspora doesn't support your version of Internet Explorer/)
end
specify {expect(@response.headers["Content-Length"]).to eq(@response.body.length.to_s)}
end
context "Specific case with no space after MSIE" do
let(:ua_string) { "Mozilla/4.0 (compatible; MSIE8.0; Windows NT 6.0) .NET CLR 2.0.50727" }
it "shouldn't complain about the browser" do
expect(subject.body).not_to match(/Diaspora doesn't support your version of Internet Explorer/)
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment