Skip to content

Commit 5673b20

Browse files
Initial commit with JEST test setup
0 parents  commit 5673b20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+8066
-0
lines changed

.babelrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"presets": [
3+
[
4+
"env",
5+
{
6+
"modules": false,
7+
"targets": {
8+
"browsers": "> 1%",
9+
"uglify": true
10+
},
11+
"useBuiltIns": true
12+
}
13+
],
14+
"react",
15+
"es2015"
16+
],
17+
"plugins": [
18+
"syntax-dynamic-import",
19+
"transform-object-rest-spread",
20+
[
21+
"transform-class-properties",
22+
{
23+
"spec": true
24+
}
25+
]
26+
]
27+
}

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
2+
#
3+
# If you find yourself ignoring temporary files generated by your text editor
4+
# or operating system, you probably want to add a global ignore instead:
5+
# git config --global core.excludesfile '~/.gitignore_global'
6+
7+
/.vscode
8+
# Ignore bundler config.
9+
/.bundle
10+
11+
/vendor/bundle
12+
13+
/config/database.yml
14+
/config/secrets.yml
15+
/config/webpacker.yml
16+
17+
# Ignore all logfiles and tempfiles.
18+
/log/*
19+
/tmp/*
20+
!/log/.keep
21+
!/tmp/.keep
22+
23+
/node_modules
24+
/yarn-error.log
25+
26+
.byebug_history
27+
/public/packs
28+
/public/packs-test
29+
/node_modules

.postcssrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
plugins:
2+
postcss-smart-import: {}
3+
postcss-cssnext: {}

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.4.2

Gemfile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
source 'https://rubygems.org'
2+
3+
git_source(:github) do |repo_name|
4+
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5+
"https://github.com/#{repo_name}.git"
6+
end
7+
8+
9+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
10+
gem 'rails', '~> 5.1.2'
11+
# Use Puma as the app server
12+
gem 'puma', '~> 3.7'
13+
# Use SCSS for stylesheets
14+
gem 'sass-rails', '~> 5.0'
15+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
16+
gem 'jbuilder', '~> 2.5'
17+
# Use ActiveModel has_secure_password
18+
# gem 'bcrypt', '~> 3.1.7'
19+
20+
# Use Capistrano for deployment
21+
# gem 'capistrano-rails', group: :development
22+
23+
gem 'webpacker', git: 'https://github.com/rails/webpacker.git'
24+
25+
group :development, :test do
26+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
27+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
28+
# Adds support for Capybara system testing and selenium driver
29+
gem 'capybara', '~> 2.13'
30+
gem 'selenium-webdriver'
31+
end
32+
33+
group :development do
34+
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
35+
gem 'web-console', '>= 3.3.0'
36+
gem 'listen', '>= 3.0.5', '< 3.2'
37+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
38+
gem 'spring'
39+
gem 'spring-watcher-listen', '~> 2.0.0'
40+
end
41+
42+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
43+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Gemfile.lock

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
GIT
2+
remote: https://github.com/rails/webpacker.git
3+
revision: b6ff104d28290554fdf0257da5601ca92057efa2
4+
specs:
5+
webpacker (3.0.2)
6+
activesupport (>= 4.2)
7+
rack-proxy (>= 0.6.1)
8+
railties (>= 4.2)
9+
10+
GEM
11+
remote: https://rubygems.org/
12+
specs:
13+
actioncable (5.1.4)
14+
actionpack (= 5.1.4)
15+
nio4r (~> 2.0)
16+
websocket-driver (~> 0.6.1)
17+
actionmailer (5.1.4)
18+
actionpack (= 5.1.4)
19+
actionview (= 5.1.4)
20+
activejob (= 5.1.4)
21+
mail (~> 2.5, >= 2.5.4)
22+
rails-dom-testing (~> 2.0)
23+
actionpack (5.1.4)
24+
actionview (= 5.1.4)
25+
activesupport (= 5.1.4)
26+
rack (~> 2.0)
27+
rack-test (>= 0.6.3)
28+
rails-dom-testing (~> 2.0)
29+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
30+
actionview (5.1.4)
31+
activesupport (= 5.1.4)
32+
builder (~> 3.1)
33+
erubi (~> 1.4)
34+
rails-dom-testing (~> 2.0)
35+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
36+
activejob (5.1.4)
37+
activesupport (= 5.1.4)
38+
globalid (>= 0.3.6)
39+
activemodel (5.1.4)
40+
activesupport (= 5.1.4)
41+
activerecord (5.1.4)
42+
activemodel (= 5.1.4)
43+
activesupport (= 5.1.4)
44+
arel (~> 8.0)
45+
activesupport (5.1.4)
46+
concurrent-ruby (~> 1.0, >= 1.0.2)
47+
i18n (~> 0.7)
48+
minitest (~> 5.1)
49+
tzinfo (~> 1.1)
50+
addressable (2.5.2)
51+
public_suffix (>= 2.0.2, < 4.0)
52+
arel (8.0.0)
53+
bindex (0.5.0)
54+
builder (3.2.3)
55+
byebug (9.1.0)
56+
capybara (2.16.1)
57+
addressable
58+
mini_mime (>= 0.1.3)
59+
nokogiri (>= 1.3.3)
60+
rack (>= 1.0.0)
61+
rack-test (>= 0.5.4)
62+
xpath (~> 2.0)
63+
childprocess (0.8.0)
64+
ffi (~> 1.0, >= 1.0.11)
65+
concurrent-ruby (1.0.5)
66+
crass (1.0.3)
67+
erubi (1.7.0)
68+
ffi (1.9.18)
69+
globalid (0.4.1)
70+
activesupport (>= 4.2.0)
71+
i18n (0.9.1)
72+
concurrent-ruby (~> 1.0)
73+
jbuilder (2.7.0)
74+
activesupport (>= 4.2.0)
75+
multi_json (>= 1.2)
76+
listen (3.1.5)
77+
rb-fsevent (~> 0.9, >= 0.9.4)
78+
rb-inotify (~> 0.9, >= 0.9.7)
79+
ruby_dep (~> 1.2)
80+
loofah (2.1.1)
81+
crass (~> 1.0.2)
82+
nokogiri (>= 1.5.9)
83+
mail (2.7.0)
84+
mini_mime (>= 0.1.1)
85+
method_source (0.9.0)
86+
mini_mime (1.0.0)
87+
mini_portile2 (2.3.0)
88+
minitest (5.10.3)
89+
multi_json (1.12.2)
90+
nio4r (2.1.0)
91+
nokogiri (1.8.1)
92+
mini_portile2 (~> 2.3.0)
93+
public_suffix (3.0.1)
94+
puma (3.11.0)
95+
rack (2.0.3)
96+
rack-proxy (0.6.2)
97+
rack
98+
rack-test (0.8.2)
99+
rack (>= 1.0, < 3)
100+
rails (5.1.4)
101+
actioncable (= 5.1.4)
102+
actionmailer (= 5.1.4)
103+
actionpack (= 5.1.4)
104+
actionview (= 5.1.4)
105+
activejob (= 5.1.4)
106+
activemodel (= 5.1.4)
107+
activerecord (= 5.1.4)
108+
activesupport (= 5.1.4)
109+
bundler (>= 1.3.0)
110+
railties (= 5.1.4)
111+
sprockets-rails (>= 2.0.0)
112+
rails-dom-testing (2.0.3)
113+
activesupport (>= 4.2.0)
114+
nokogiri (>= 1.6)
115+
rails-html-sanitizer (1.0.3)
116+
loofah (~> 2.0)
117+
railties (5.1.4)
118+
actionpack (= 5.1.4)
119+
activesupport (= 5.1.4)
120+
method_source
121+
rake (>= 0.8.7)
122+
thor (>= 0.18.1, < 2.0)
123+
rake (12.3.0)
124+
rb-fsevent (0.10.2)
125+
rb-inotify (0.9.10)
126+
ffi (>= 0.5.0, < 2)
127+
ruby_dep (1.5.0)
128+
rubyzip (1.2.1)
129+
sass (3.5.3)
130+
sass-listen (~> 4.0.0)
131+
sass-listen (4.0.0)
132+
rb-fsevent (~> 0.9, >= 0.9.4)
133+
rb-inotify (~> 0.9, >= 0.9.7)
134+
sass-rails (5.0.7)
135+
railties (>= 4.0.0, < 6)
136+
sass (~> 3.1)
137+
sprockets (>= 2.8, < 4.0)
138+
sprockets-rails (>= 2.0, < 4.0)
139+
tilt (>= 1.1, < 3)
140+
selenium-webdriver (3.8.0)
141+
childprocess (~> 0.5)
142+
rubyzip (~> 1.0)
143+
spring (2.0.2)
144+
activesupport (>= 4.2)
145+
spring-watcher-listen (2.0.1)
146+
listen (>= 2.7, < 4.0)
147+
spring (>= 1.2, < 3.0)
148+
sprockets (3.7.1)
149+
concurrent-ruby (~> 1.0)
150+
rack (> 1, < 3)
151+
sprockets-rails (3.2.1)
152+
actionpack (>= 4.0)
153+
activesupport (>= 4.0)
154+
sprockets (>= 3.0.0)
155+
thor (0.20.0)
156+
thread_safe (0.3.6)
157+
tilt (2.0.8)
158+
tzinfo (1.2.4)
159+
thread_safe (~> 0.1)
160+
web-console (3.5.1)
161+
actionview (>= 5.0)
162+
activemodel (>= 5.0)
163+
bindex (>= 0.4.0)
164+
railties (>= 5.0)
165+
websocket-driver (0.6.5)
166+
websocket-extensions (>= 0.1.0)
167+
websocket-extensions (0.1.3)
168+
xpath (2.1.0)
169+
nokogiri (~> 1.3)
170+
171+
PLATFORMS
172+
ruby
173+
174+
DEPENDENCIES
175+
byebug
176+
capybara (~> 2.13)
177+
jbuilder (~> 2.5)
178+
listen (>= 3.0.5, < 3.2)
179+
puma (~> 3.7)
180+
rails (~> 5.1.2)
181+
sass-rails (~> 5.0)
182+
selenium-webdriver
183+
spring
184+
spring-watcher-listen (~> 2.0.0)
185+
tzinfo-data
186+
web-console (>= 3.3.0)
187+
webpacker!
188+
189+
BUNDLED WITH
190+
1.16.0

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks

app/assets/config/manifest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//= link_tree ../images
2+
//= link_directory ../stylesheets .css

app/assets/images/.keep

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* This is a manifest file that'll be compiled into application.css, which will include all the files
3+
* listed below.
4+
*
5+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6+
* vendor/assets/stylesheets directory can be referenced here using a relative path.
7+
*
8+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10+
* files in this directory. Styles in this file should be added after the last require_* statement.
11+
* It is generally better to create a new file per style scope.
12+
*
13+
*= require_tree .
14+
*= require_self
15+
*/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class ApplicationController < ActionController::Base
2+
protect_from_forgery with: :exception
3+
4+
def index
5+
end
6+
end

app/controllers/concerns/.keep

Whitespace-only changes.

app/helpers/application_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

app/javascript/packs/App.jsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { Component } from 'react';
2+
3+
class App extends Component {
4+
5+
state = {
6+
counter: 0
7+
}
8+
9+
increment = () => {
10+
let { counter } = this.state;
11+
counter = counter + 1;
12+
this.setState({
13+
counter
14+
});
15+
}
16+
17+
render() {
18+
let { counter } = this.state;
19+
return (
20+
<div>
21+
<h1> Tesing component </h1>
22+
<h1> Counter: {counter} </h1>
23+
<button onClick={this.increment}>Increment</button>
24+
</div>
25+
);
26+
}
27+
}
28+
29+
export default App;

0 commit comments

Comments
 (0)