Skip to content

Commit bd3599a

Browse files
committed
Fixed a couple real bugs in the test and app code
Tests passing locally with poltergeist.
1 parent 12f9444 commit bd3599a

File tree

11 files changed

+94
-78
lines changed

11 files changed

+94
-78
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ rvm:
44
- 2.3.1
55
sudo: false
66
addons:
7+
sauce_connect:
8+
username: "judahmeek"
9+
jwt:
10+
secure: "A/bVoePCHtwLGH4wVLCHK39+tml2axc/M/Mjnpg4m4bjgMI7GD4YqlnZMNrUBzNAv+Q66pp0sWjTy/Xm4tDaYnSxJFrWjD2wn5ZPpMEyB162nR+QqYqWl5DqP+jlOuIK+7iRmrRTlDS4LLTl43+nWxvRB16aat2U01P/+GKtQ+o="
711
apt:
812
sources:
913
- ubuntu-toolchain-r-test
@@ -15,6 +19,7 @@ env:
1519
global:
1620
- RAILS_ENV=test
1721
- CXX=g++-4.9
22+
- SAUCE_LABS_URL=http://judahmeek:[email protected]:80/wd/hub
1823
install:
1924
- bundle install
2025
- nvm install 6.3

Gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ group :test do
104104
gem "generator_spec"
105105
gem "launchy"
106106
gem "poltergeist"
107-
gem "rspec-rails", "3.5.0.beta3"
107+
gem "rspec-rails", "~> 3"
108108
gem "rspec-retry"
109-
gem "selenium-webdriver", require: !["poltergeist", "poltergeist_errors_ok", "webkit"].include?(ENV["DRIVER"])
109+
gem "selenium-webdriver", "<3.0.0", require: !["poltergeist", "poltergeist_errors_ok", "webkit"].include?(ENV["DRIVER"])
110110
end

Gemfile.lock

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ GEM
3838
i18n (~> 0.7)
3939
minitest (~> 5.1)
4040
tzinfo (~> 1.1)
41-
addressable (2.4.0)
41+
addressable (2.5.0)
42+
public_suffix (~> 2.0, >= 2.0.2)
4243
archive-zip (0.7.0)
4344
io-like (~> 0.3.0)
4445
arel (7.1.4)
4546
ast (2.3.0)
46-
autoprefixer-rails (6.5.1.1)
47+
autoprefixer-rails (6.5.3)
4748
execjs
4849
awesome_print (1.7.0)
4950
binding_of_caller (0.7.2)
@@ -82,7 +83,7 @@ GEM
8283
execjs
8384
coffee-script-source (1.10.0)
8485
concurrent-ruby (1.0.2)
85-
connection_pool (2.2.0)
86+
connection_pool (2.2.1)
8687
coveralls (0.8.15)
8788
json (>= 1.8, < 3)
8889
simplecov (~> 0.12.0)
@@ -138,7 +139,7 @@ GEM
138139
nio4r (1.2.1)
139140
nokogiri (1.6.8.1)
140141
mini_portile2 (~> 2.1.0)
141-
parser (2.3.1.4)
142+
parser (2.3.2.0)
142143
ast (~> 2.2)
143144
pg (0.19.0)
144145
poltergeist (1.11.0)
@@ -150,7 +151,7 @@ GEM
150151
coderay (~> 1.1.0)
151152
method_source (~> 0.8.1)
152153
slop (~> 3.4)
153-
pry-byebug (3.4.0)
154+
pry-byebug (3.4.1)
154155
byebug (~> 9.0)
155156
pry (~> 0.10)
156157
pry-doc (0.9.0)
@@ -164,7 +165,8 @@ GEM
164165
pry-stack_explorer (0.4.9.2)
165166
binding_of_caller (>= 0.7)
166167
pry (>= 0.9.11)
167-
puma (3.6.0)
168+
public_suffix (2.0.4)
169+
puma (3.6.2)
168170
rack (2.0.1)
169171
rack-test (0.6.3)
170172
rack (>= 1.0)
@@ -201,34 +203,33 @@ GEM
201203
rb-fsevent (0.9.8)
202204
rb-inotify (0.9.7)
203205
ffi (>= 0.5.0)
204-
rdoc (4.2.2)
205-
json (~> 1.4)
206+
rdoc (4.3.0)
206207
react_on_rails (6.1.2)
207208
addressable
208209
connection_pool
209210
execjs (~> 2.5)
210211
foreman
211212
rails (>= 3.2)
212213
rainbow (~> 2.1)
213-
rspec-core (3.5.0.beta3)
214-
rspec-support (= 3.5.0.beta3)
215-
rspec-expectations (3.5.0.beta3)
214+
rspec-core (3.5.4)
215+
rspec-support (~> 3.5.0)
216+
rspec-expectations (3.5.0)
216217
diff-lcs (>= 1.2.0, < 2.0)
217-
rspec-support (= 3.5.0.beta3)
218-
rspec-mocks (3.5.0.beta3)
218+
rspec-support (~> 3.5.0)
219+
rspec-mocks (3.5.0)
219220
diff-lcs (>= 1.2.0, < 2.0)
220-
rspec-support (= 3.5.0.beta3)
221-
rspec-rails (3.5.0.beta3)
221+
rspec-support (~> 3.5.0)
222+
rspec-rails (3.5.2)
222223
actionpack (>= 3.0)
223224
activesupport (>= 3.0)
224225
railties (>= 3.0)
225-
rspec-core (= 3.5.0.beta3)
226-
rspec-expectations (= 3.5.0.beta3)
227-
rspec-mocks (= 3.5.0.beta3)
228-
rspec-support (= 3.5.0.beta3)
226+
rspec-core (~> 3.5.0)
227+
rspec-expectations (~> 3.5.0)
228+
rspec-mocks (~> 3.5.0)
229+
rspec-support (~> 3.5.0)
229230
rspec-retry (0.5.2)
230231
rspec-core (> 3.3, < 3.6)
231-
rspec-support (3.5.0.beta3)
232+
rspec-support (3.5.0)
232233
rubocop (0.45.0)
233234
parser (>= 2.3.1.1, < 3.0)
234235
powerpack (~> 0.1)
@@ -248,13 +249,13 @@ GEM
248249
sprockets (>= 2.8, < 4.0)
249250
sprockets-rails (>= 2.0, < 4.0)
250251
tilt (>= 1.1, < 3)
251-
scss_lint (0.50.2)
252+
scss_lint (0.50.3)
252253
rake (>= 0.9, < 12)
253254
sass (~> 3.4.20)
254255
sdoc (0.4.2)
255256
json (~> 1.7, >= 1.7.7)
256257
rdoc (~> 4.0)
257-
selenium-webdriver (3.0.0)
258+
selenium-webdriver (2.53.4)
258259
childprocess (~> 0.5)
259260
rubyzip (~> 1.0)
260261
websocket (~> 1.0)
@@ -336,14 +337,14 @@ DEPENDENCIES
336337
rails_12factor
337338
rainbow
338339
react_on_rails (~> 6.1)
339-
rspec-rails (= 3.5.0.beta3)
340+
rspec-rails (~> 3)
340341
rspec-retry
341342
rubocop
342343
ruby-lint
343344
sass-rails
344345
scss_lint
345346
sdoc
346-
selenium-webdriver
347+
selenium-webdriver (< 3.0.0)
347348
spring
348349
spring-commands-rspec
349350
sqlite3

app/views/pages/_header.html.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
id: "git-commit-sha" %>
55
</p>
66
<ul>
7+
<li>
8+
<%= link_to "Can ShakaCode Help You?",
9+
"https://blog.shakacode.com/can-shakacode-help-you-4a5b1e5a8a63#.jex6tg9w9" %>
10+
</li>
11+
712
<li>
813
See the
914
<%= link_to "github.com/shakacode/react-webpack-rails-tutorial/README.md",

client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ export default class CommentList extends BaseComponent {
3535

3636
render() {
3737
const { $$comments, cssTransitionGroupClassNames } = this.props;
38-
const commentNodes = $$comments.map($$comment =>
38+
const commentNodes = $$comments.map(($$comment, index) =>
3939

4040
// `key` is a React-specific concept and is not mandatory for the
4141
// purpose of this tutorial. if you're curious, see more here:
4242
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
4343
<Comment
44-
key={$$comment.get('id')}
44+
key={$$comment.get('id') || index}
4545
author={$$comment.get('author')}
4646
text={$$comment.get('text')}
4747
/>

client/app/bundles/comments/components/NavigationBar/NavigationBar.jsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// eslint-disable new-cap
33

44
import classNames from 'classnames';
5+
import _ from 'lodash';
56
import React, { PropTypes } from 'react';
67

78
import CommentsCount from './CommentsCount';
@@ -49,29 +50,17 @@ const NavigationBar = (props) => {
4950
'shakacode/react-webpack-rails-tutorial'
5051
}
5152
>
52-
Source on Github
53+
Source
5354
</a>
5455
</li>
5556
<li>
5657
<a
5758
href={
58-
'http://www.railsonmaui.com/' +
59-
'blog/2014/10/03/integrating' +
60-
'-webpack-and-the-es6-transpiler' +
61-
'-into-an-existing-rails-project/'
62-
}
63-
>Tutorials</a>
64-
</li>
65-
<li>
66-
<a
67-
href={
68-
'http://forum.shakacode.com/' +
69-
't/fast-rich-client-rails-development' +
70-
'-with-webpack-and-the-es6-transpiler/82/22'
59+
'https://forum.shakacode.com/c/reactjs'
7160
}
7261
>Forum</a>
7362
</li>
74-
{commentsCount && CommentsCount({ commentsCount })}
63+
{_.isNumber(commentsCount) && CommentsCount({ commentsCount })}
7564
</ul>
7665
</div>
7766
</div>

client/package.json

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
"lint": "eslint --ext .js,.jsx ."
4040
},
4141
"dependencies": {
42-
"autoprefixer": "^6.5.1",
42+
"autoprefixer": "^6.5.3",
4343
"axios": "^0.15.2",
4444
"babel": "^6.5.2",
4545
"babel-cli": "^6.18.0",
4646
"babel-core": "^6.18.2",
47-
"babel-loader": "^6.2.7",
47+
"babel-loader": "^6.2.8",
4848
"babel-plugin-transform-es2015-modules-amd": "^6.18.0",
4949
"babel-polyfill": "^6.16.0",
5050
"babel-preset-es2015": "^6.18.0",
@@ -54,7 +54,7 @@
5454
"bootstrap-loader": "^1.3.0",
5555
"bootstrap-sass": "^3.3.7",
5656
"classnames": "^2.2.5",
57-
"css-loader": "^0.25.0",
57+
"css-loader": "^0.26.0",
5858
"es5-shim": "^4.5.9",
5959
"expose-loader": "^0.7.1",
6060
"extract-text-webpack-plugin": "^1.0.1",
@@ -64,19 +64,19 @@
6464
"jquery": "^3.1.1",
6565
"jquery-ujs": "^1.2.2",
6666
"loader-utils": "^0.2.16",
67-
"lodash": "^4.16.6",
67+
"lodash": "^4.17.2",
6868
"marked": "^0.3.6",
69-
"node-sass": "^3.11.0",
69+
"node-sass": "^3.13.0",
7070
"node-uuid": "^1.4.7",
71-
"postcss-loader": "^1.1.0",
72-
"react": "^15.3.2",
73-
"react-addons-pure-render-mixin": "^15.3.2",
74-
"react-bootstrap": "^0.30.6",
75-
"react-dom": "^15.3.2",
76-
"react-on-rails": "^6.1.2",
77-
"react-redux": "^4.4.5",
71+
"postcss-loader": "^1.1.1",
72+
"react": "^15.4.1",
73+
"react-addons-pure-render-mixin": "^15.4.1",
74+
"react-bootstrap": "^0.30.7",
75+
"react-dom": "^15.4.1",
76+
"react-on-rails": "^6.2.1",
77+
"react-redux": "^4.4.6",
7878
"react-router": "^3.0.0",
79-
"react-router-redux": "^4.0.6",
79+
"react-router-redux": "^4.0.7",
8080
"redux": "^3.6.0",
8181
"redux-thunk": "^2.1.0",
8282
"resolve-url-loader": "^1.6.0",
@@ -88,25 +88,25 @@
8888
"webpack": "^1.13.3"
8989
},
9090
"devDependencies": {
91-
"babel-eslint": "^7.1.0",
91+
"babel-eslint": "^7.1.1",
9292
"babel-plugin-react-transform": "^2.0.2",
9393
"body-parser": "^1.15.2",
9494
"chai": "^3.5.0",
9595
"chai-immutable": "^1.6.0",
96-
"eslint": "^3.9.1",
97-
"eslint-config-shakacode": "^13.0.1-beta.1",
96+
"eslint": "^3.10.2",
97+
"eslint-config-shakacode": "^13.1.0",
9898
"eslint-import-resolver-webpack": "^0.7.0",
99-
"eslint-plugin-import": "^2.0.1",
99+
"eslint-plugin-import": "^2.2.0",
100100
"eslint-plugin-jsx-a11y": "^2.2.3",
101-
"eslint-plugin-react": "^6.5.0",
101+
"eslint-plugin-react": "^6.7.1",
102102
"estraverse-fb": "^1.3.1",
103103
"express": "^4.14.0",
104104
"jsdom": "^9.8.3",
105105
"mocha": "^3.1.2",
106106
"pug": "^2.0.0-beta6",
107-
"react-addons-test-utils": "^15.3.2",
107+
"react-addons-test-utils": "^15.4.1",
108108
"react-transform-hmr": "^1.0.4",
109-
"sleep": "^4.0.0",
109+
"sleep": "^5.0.0",
110110
"webpack-dev-server": "^1.16.2"
111111
}
112112
}

spec/features/add_new_comment_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
include_examples "New Comment Submission", false
4343
include_examples "Validation errors displaying"
4444
end
45-
context "via the Stacked Form", form: :stacked, driver: js_selenium_driver do
45+
context "via the Stacked Form", form: :stacked do
4646
include_examples "New Comment Submission", false
4747
include_examples "Validation errors displaying"
4848
end

spec/rails_helper.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# Maybe selenium_firefox webdriver only works for Travis-CI builds.
4242
# 2016-03-06: Phantomjs, all options fails on MacOs
4343
# Same for webkit
44-
default_driver = :selenium_chrome
44+
default_driver = :poltergeist # :selenium_chrome
4545

4646
supported_drivers = %i( poltergeist poltergeist_errors_ok
4747
poltergeist_no_animations webkit
@@ -56,7 +56,9 @@
5656
when :poltergeist, :poltergeist_errors_ok, :poltergeist_no_animations
5757
require "capybara/poltergeist"
5858
opts = {
59-
extensions: ["#{Rails.root}/spec/support/phantomjs-disable-animations.js"]
59+
extensions: ["#{Rails.root}/spec/support/phantomjs-disable-animations.js"],
60+
window_size: [1280, 720],
61+
screen_size: [1600, 1200]
6062
}
6163

6264
Capybara.register_driver :poltergeist_no_animations do |app|

spec/spec_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
# Show retry status in spec process
4141
config.verbose_retry = true
4242
# Try twice (retry once)
43-
config.default_retry_count = 2
43+
config.default_retry_count = 3
4444
# Only retry when Selenium raises Net::ReadTimeout
45-
config.exceptions_to_retry = [Net::ReadTimeout]
45+
# config.exceptions_to_retry = [Net::ReadTimeout]
4646
end
4747

4848
# rspec-mocks config goes here. You can use an alternate test double

0 commit comments

Comments
 (0)