Permalink
Browse files

Enable Turbolinks

  • Loading branch information...
1 parent 342c9d9 commit ed6f3ab069d6f2d82a422f8b721366adc569801e @reyesyang committed Dec 30, 2013
View
@@ -26,6 +26,7 @@ gem 'uglifier', '>= 1.0.3'
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
+gem 'jquery-turbolinks'
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
View
@@ -81,6 +81,9 @@ GEM
jquery-rails (3.0.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
+ jquery-turbolinks (2.0.1)
+ railties (>= 3.1.0)
+ turbolinks
json (1.8.1)
kgio (2.8.1)
launchy (2.4.2)
@@ -232,6 +235,7 @@ DEPENDENCIES
haml
jbuilder (~> 1.5.1)
jquery-rails
+ jquery-turbolinks
launchy
less-rails
mysql2
@@ -6,6 +6,8 @@
//
//= require jquery
//= require jquery_ujs
+//= require jquery.turbolinks
+//= require turbolinks
//= require jquery.cookie
//= require twitter/bootstrap
//= require timeago
@@ -6,8 +6,8 @@
%meta{name: 'description', content: "#{@page_description || APP_CONFIG['default_description']}"}
%meta{:'http-equiv' => 'X-UA-Compativle', content: 'IE=Edge'}
= csrf_meta_tag
- = stylesheet_link_tag 'application'
- = javascript_include_tag 'application'
+ = stylesheet_link_tag 'application', data: { :'turbolinks-track' => true }
+ = javascript_include_tag 'application', data: { :'turbolinks-track' => true }
= javascript_include_tag Rails.env.test? ? 'stubbyid' : 'https://login.persona.org/include.js'
= javascript_include_tag 'persona'
= yield :head
@@ -5,8 +5,8 @@
%meta{:charset => 'utf-8'}
%meta{:name => 'description', :content => "#{@page_description || APP_CONFIG['default_description']}"}
= csrf_meta_tag
- = stylesheet_link_tag 'application'
- = javascript_include_tag 'application'
+ = stylesheet_link_tag 'application', data: { :'turbolink-track' => true }
+ = javascript_include_tag 'application', data: { :'turbolink-track' => true }
= yield :head
/[if lt IE 9]
%script{:src => "//html5shim.googlecode.com/svn/trunk/html5.js"}
@@ -3,7 +3,9 @@
feature "Articles" do
scenario "Post a new article", js: true do
sign_in APP_CONFIG[:admin_email]
- click_link "现在就发表一篇"
+ click_link "现在就发表一篇"
+
+ sleep 1
expect(current_path).to eq new_article_path
article = build :article
@@ -31,9 +33,11 @@
sign_in APP_CONFIG[:admin_email]
click_link article.title
+ sleep 1
expect(current_path).to eq article_path(article)
click_link "编辑"
+ sleep 1
expect(current_path).to eq edit_article_path(article)
within(".edit_article") do
@@ -58,6 +62,7 @@
sign_in APP_CONFIG[:admin_email]
click_link article.title
+ sleep 1
expect(current_path).to eq article_path(article)
click_link "删除"
@@ -10,7 +10,7 @@
expect(page).to have_content "登录"
end
- scenario "cancel sign out", js: true, focus: true do
+ scenario "cancel sign out", js: true do
visit root_path
sign_in APP_CONFIG["admin_email"]

0 comments on commit ed6f3ab

Please sign in to comment.