Skip to content
This repository has been archived by the owner on Oct 11, 2019. It is now read-only.

Commit

Permalink
Issue #30
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-alexandrov committed Jul 4, 2013
1 parent ae56ef2 commit 371f338
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion lib/assets/javascripts/_request_manager.js.coffee
Expand Up @@ -33,7 +33,7 @@ class RequestManager
else
state = History.getState()

if url? && (url != encodeURI(self._normalize(state.url)))
if url? && (url != self._normalize(window.location.href))
self._redirect_to(url, $target, state, xhr)

$target.html(data)
Expand Down
2 changes: 1 addition & 1 deletion spec/cases/helpers_spec.rb
Expand Up @@ -3,6 +3,6 @@
feature 'Assets change detection' do
scenario 'with an assets digest enabled' do
visit('/')
page.should have_xpath('//head/meta[@name="assets-digest"]')
page.should have_xpath("//head/meta[@name='assets-digest']", :visible => false)
end
end
26 changes: 13 additions & 13 deletions spec/cases/request_spec.rb
Expand Up @@ -2,7 +2,7 @@

describe ActionDispatch::Request do
describe 'request' do
before :all do
before :all do
@request = FactoryGirl.build(:request)
end

Expand All @@ -24,7 +24,7 @@
end
end

context 'wiselinks methods' do
context 'wiselinks methods' do
it 'should not be a wiselinks request' do
@request.wiselinks?.should == false
end
Expand All @@ -36,19 +36,19 @@
it 'should not be a wiselinks partial request' do
@request.wiselinks_partial?.should == false
end
end
end
end

describe 'wiselinks_request' do
before :all do
before :all do
@request = FactoryGirl.build(:wiselinks_request)
end

it "should be" do
@request.should be
end

context 'wiselinks methods' do
context 'wiselinks methods' do
it 'should be a wiselinks request' do
@request.wiselinks?.should == true
end
Expand All @@ -60,19 +60,19 @@
it 'should not be a wiselinks partial request' do
@request.wiselinks_partial?.should == false
end
end
end
end

describe 'wiselinks_template_request' do
before :all do
before :all do
@request = FactoryGirl.build(:wiselinks_template_request)
end

it "should be" do
@request.should be
end

context 'wiselinks methods' do
context 'wiselinks methods' do
it 'should be a wiselinks request' do
@request.wiselinks?.should == true
end
Expand All @@ -84,19 +84,19 @@
it 'should not be a wiselinks partial request' do
@request.wiselinks_partial?.should == false
end
end
end
end

describe 'wiselinks_partial_request' do
before :all do
before :all do
@request = FactoryGirl.build(:wiselinks_partial_request)
end

it "should be" do
@request.should be
end

context 'wiselinks methods' do
context 'wiselinks methods' do
it 'should be a wiselinks request' do
@request.wiselinks?.should == true
end
Expand All @@ -108,6 +108,6 @@
it 'should be a wiselinks partial request' do
@request.wiselinks_partial?.should == true
end
end
end
end
end
7 changes: 7 additions & 0 deletions spec/helper.rb
Expand Up @@ -17,3 +17,10 @@

require 'factory_girl'
FactoryGirl.find_definitions

RSpec::Matchers::define :have_meta do |name|
match do |page|
puts Capybara.string(page.body)
Capybara.string(page.body).has_selector?(:xpath, "//head/meta[@name='#{name}']")
end
end
2 changes: 1 addition & 1 deletion spec/requests/trailing_slash_spec.rb
Expand Up @@ -4,7 +4,7 @@
context 'w/ trailing slash' do
it 'sets X-Wiselinks header field correctly' do
get('trailing-slash/', {}, {"X-Wiselinks" => 'template'})
response.headers['X-Wiselinks-Url'].last.should == '/'
response.headers['X-Wiselinks-Url'].should =~ /trailing-slash\z/
end
end

Expand Down

0 comments on commit 371f338

Please sign in to comment.