Sha256: da5f670f9dbc0f1f4e795e8432c6a1e3f140aec427c9086d1168aa699c8c2d31

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe 'pjax support', :type => :request, :js => true do
  it "should alter the metatags when using pjax" do
    visit('/test/empty')
    page.should have_selector('meta[name=edifice-view_name][content=empty]')
    
    page.evaluate_script('jQuery.pjax({url: "/test/base", container: "body"})')
    page.should have_selector('meta[name=edifice-view_name][content=base]')
  end
  
  it "should not alter the metatags otherwise" do
    visit('/test/empty')
    page.should have_selector('meta[name=edifice-view_name][content=empty]')
    
    page.evaluate_script('jQuery.ajax("/test/base")')
    page.should have_selector('meta[name=edifice-view_name][content=empty]')
  end
  
  it "should alter the body classes when using pjax" do
    visit('/test/empty')
    page.should have_selector('body.v_empty')
    
    page.evaluate_script('jQuery.pjax({url: "/test/base", container: "body"})')
    page.should have_selector('body.v_base')
  end
  
  it "should not alter the body classes otherwise" do
    visit('/test/empty')
    page.should have_selector('body.v_empty')
    
    page.evaluate_script('jQuery.ajax("/test/base")')
    page.should have_selector('body.v_empty')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
edifice-1.3.0 spec/pjax_support_spec.rb
edifice-1.2.0 spec/pjax_support_spec.rb
edifice-1.1.1 spec/pjax_support_spec.rb
edifice-1.1.0 spec/pjax_support_spec.rb