Skip to content

Commit 62e04d0

Browse files
authored
Merge pull request #26 from yasslab/add-coderdojo-list
各DojoのリストをStaticで表示した
2 parents ce5590a + 6ec2329 commit 62e04d0

File tree

9 files changed

+760
-13
lines changed

9 files changed

+760
-13
lines changed

.rspec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--color
2+
#--warnings
3+
--require spec_helper

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ gem 'uglifier', '>= 1.3.0'
2020
group :development do
2121
gem 'web-console', '~> 2.0'
2222
gem 'spring', '1.7.1'
23+
gem 'rspec-rails', '~> 3.0.0'
2324
end
2425

2526
group :development, :test do

Gemfile.lock

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,22 @@ GEM
120120
rake (11.1.2)
121121
rdoc (4.2.2)
122122
json (~> 1.4)
123+
rspec-core (3.0.4)
124+
rspec-support (~> 3.0.0)
125+
rspec-expectations (3.0.4)
126+
diff-lcs (>= 1.2.0, < 2.0)
127+
rspec-support (~> 3.0.0)
128+
rspec-mocks (3.0.4)
129+
rspec-support (~> 3.0.0)
130+
rspec-rails (3.0.2)
131+
actionpack (>= 3.0)
132+
activesupport (>= 3.0)
133+
railties (>= 3.0)
134+
rspec-core (~> 3.0.0)
135+
rspec-expectations (~> 3.0.0)
136+
rspec-mocks (~> 3.0.0)
137+
rspec-support (~> 3.0.0)
138+
rspec-support (3.0.4)
123139
sass (3.4.22)
124140
sass-rails (5.0.4)
125141
railties (>= 4.0.0, < 5.0)
@@ -194,6 +210,7 @@ DEPENDENCIES
194210
jquery-rails
195211
pg (~> 0.18.4)
196212
rails (= 4.2.6)
213+
rspec-rails (~> 3.0.0)
197214
sass-rails (~> 5.0)
198215
scrivito (~> 1.3.0)
199216
scrivito_section_widgets (= 1.0.0)
@@ -209,4 +226,4 @@ RUBY VERSION
209226
ruby 2.3.1p112
210227

211228
BUNDLED WITH
212-
1.12.3
229+
1.13.6

app/views/custom_widget/show.html.erb

Lines changed: 595 additions & 10 deletions
Large diffs are not rendered by default.

db/test

0 Bytes
Binary file not shown.

public/css/style.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ a {
251251

252252
.grayscale-bg {
253253
background: #f7f7f7;
254-
width: 120%
255254
}
256255

257256
.cover {
@@ -337,7 +336,8 @@ a {
337336
color: #fff;
338337
border-radius: .3em;
339338
padding: .2em;
340-
margin: .1em
339+
margin: .1em;
340+
background: #2275CA
341341
}
342342

343343
body {
@@ -353,3 +353,8 @@ body {
353353
margin-left: -10%;
354354
margin-right: -10%;
355355
}
356+
357+
.loaded{
358+
width: 90%;
359+
display: inline-block
360+
}

spec/rails_helper.rb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This file is copied to spec/ when you run 'rails generate rspec:install'
2+
ENV["RAILS_ENV"] ||= 'test'
3+
require 'spec_helper'
4+
require File.expand_path("../../config/environment", __FILE__)
5+
require 'rspec/rails'
6+
7+
# Requires supporting ruby files with custom matchers and macros, etc, in
8+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
9+
# run as spec files by default. This means that files in spec/support that end
10+
# in _spec.rb will both be required and run as specs, causing the specs to be
11+
# run twice. It is recommended that you do not name files matching this glob to
12+
# end with _spec.rb. You can configure this pattern with the --pattern
13+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
14+
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
15+
16+
# Checks for pending migrations before tests are run.
17+
# If you are not using ActiveRecord, you can remove this line.
18+
ActiveRecord::Migration.maintain_test_schema!
19+
20+
RSpec.configure do |config|
21+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
22+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
23+
24+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
25+
# examples within a transaction, remove the following line or assign false
26+
# instead of true.
27+
config.use_transactional_fixtures = true
28+
29+
# RSpec Rails can automatically mix in different behaviours to your tests
30+
# based on their file location, for example enabling you to call `get` and
31+
# `post` in specs under `spec/controllers`.
32+
#
33+
# You can disable this behaviour by removing the line below, and instead
34+
# explicitly tag your specs with their type, e.g.:
35+
#
36+
# RSpec.describe UsersController, :type => :controller do
37+
# # ...
38+
# end
39+
#
40+
# The different available types are documented in the features, such as in
41+
# https://relishapp.com/rspec/rspec-rails/docs
42+
config.infer_spec_type_from_file_location!
43+
end

spec/spec_helper.rb

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
2+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
4+
# file to always be loaded, without a need to explicitly require it in any files.
5+
#
6+
# Given that it is always loaded, you are encouraged to keep this file as
7+
# light-weight as possible. Requiring heavyweight dependencies from this file
8+
# will add to the boot time of your test suite on EVERY test run, even for an
9+
# individual file that may not need all of that loaded. Instead, make a
10+
# separate helper file that requires this one and then use it only in the specs
11+
# that actually need it.
12+
#
13+
# The `.rspec` file also contains a few flags that are not defaults but that
14+
# users commonly want.
15+
#
16+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17+
RSpec.configure do |config|
18+
# The settings below are suggested to provide a good initial experience
19+
# with RSpec, but feel free to customize to your heart's content.
20+
=begin
21+
# These two settings work together to allow you to limit a spec run
22+
# to individual examples or groups you care about by tagging them with
23+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
24+
# get run.
25+
config.filter_run :focus
26+
config.run_all_when_everything_filtered = true
27+
28+
# Many RSpec users commonly either run the entire suite or an individual
29+
# file, and it's useful to allow more verbose output when running an
30+
# individual spec file.
31+
if config.files_to_run.one?
32+
# Use the documentation formatter for detailed output,
33+
# unless a formatter has already been configured
34+
# (e.g. via a command-line flag).
35+
config.default_formatter = 'doc'
36+
end
37+
38+
# Print the 10 slowest examples and example groups at the
39+
# end of the spec run, to help surface which specs are running
40+
# particularly slow.
41+
config.profile_examples = 10
42+
43+
# Run specs in random order to surface order dependencies. If you find an
44+
# order dependency and want to debug it, you can fix the order by providing
45+
# the seed, which is printed after each run.
46+
# --seed 1234
47+
config.order = :random
48+
49+
# Seed global randomization in this process using the `--seed` CLI option.
50+
# Setting this allows you to use `--seed` to deterministically reproduce
51+
# test failures related to randomization by passing the same `--seed` value
52+
# as the one that triggered the failure.
53+
Kernel.srand config.seed
54+
55+
# rspec-expectations config goes here. You can use an alternate
56+
# assertion/expectation library such as wrong or the stdlib/minitest
57+
# assertions if you prefer.
58+
config.expect_with :rspec do |expectations|
59+
# Enable only the newer, non-monkey-patching expect syntax.
60+
# For more details, see:
61+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
62+
expectations.syntax = :expect
63+
end
64+
65+
# rspec-mocks config goes here. You can use an alternate test double
66+
# library (such as bogus or mocha) by changing the `mock_with` option here.
67+
config.mock_with :rspec do |mocks|
68+
# Enable only the newer, non-monkey-patching expect syntax.
69+
# For more details, see:
70+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71+
mocks.syntax = :expect
72+
73+
# Prevents you from mocking or stubbing a method that does not exist on
74+
# a real object. This is generally recommended.
75+
mocks.verify_partial_doubles = true
76+
end
77+
=end
78+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require 'rails_helper'
2+
3+
RSpec.describe 'custom_widget/show.html.erb', type: :view do
4+
before do
5+
render
6+
end
7+
8+
it "response succesfully with content" do
9+
expect(response).to be
10+
end
11+
12+
it "With coderdojo list" do
13+
assert_select "p.ng-binding", count:54
14+
end
15+
end

0 commit comments

Comments
 (0)