Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use test-unit-rails instead of rspec-rails #254

Merged
merged 46 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2ed91f9
Remove spec files
okkez Jul 25, 2018
b169950
Replace rspec-rails with test-unit-rails
okkez Jul 25, 2018
70c1985
Enable test_unit
okkez Jul 25, 2018
7801282
Simplify
okkez Jul 25, 2018
5dc6597
Add test for some classes
okkez Jul 27, 2018
be4753a
Add WebMock
okkez Jul 27, 2018
9ff7a7e
Add models/plugin_test.rb
okkez Jul 27, 2018
fdcf676
Add models/user_test.rb
okkez Jul 27, 2018
2f88d59
Add helper module FixutrePath
okkez Jul 30, 2018
ca79266
Add test/lib/filte_reverse_reader_test.rb
okkez Jul 30, 2018
00d06c3
Add test/integration/dashboard_test.rb
okkez Jul 30, 2018
51e900d
Add more assertions
okkez Jul 30, 2018
10d2876
Add test/integration/fluentd_ui_update_checking_test.rb
okkez Jul 30, 2018
d617f9f
Add test/integration/sesstions_test.rb
okkez Jul 30, 2018
4f950bb
Remove needless configuration
okkez Jul 30, 2018
4927e7e
Use chromedriver-helper and update gems
okkez Jul 30, 2018
14857e8
Return daemon instance from stub_daemon
okkez Jul 30, 2018
7a6d813
Add integration test
okkez Jul 30, 2018
b01ad26
Add system test using JavaScript
okkez Jul 30, 2018
a7247df
Strip heredoc
okkez Jul 31, 2018
3567a98
Add test/integration/fluentd/setting/histories_test.rb
okkez Jul 31, 2018
2e3d599
Add test/integration/fluentd/setting/notes_test.rb
okkez Jul 31, 2018
949ca1a
Add test/integration/fluentd/setting/running_backup_test.rb
okkez Jul 31, 2018
b537b9d
Add test/decorators/plugin_decorator_test.rb
okkez Aug 1, 2018
bc76f8c
Add test/controllers/application_controller_test.rb
okkez Aug 1, 2018
5d25cf1
Add test/controllers/polling_controller_test.rb
okkez Aug 1, 2018
a6e90b0
Remove garbage
okkez Aug 1, 2018
04b043c
Add test/controllers/misc_controller_test.rb
okkez Aug 1, 2018
a6d31ee
Add test/controllers/fluentd/agents_controller_test.rb
okkez Aug 1, 2018
90e6df5
Add test/lib/*_test.rb
okkez Aug 2, 2018
a2f0a29
Add test/system/fluentd/setting/*_test.rb
okkez Aug 2, 2018
e6e2647
Add test/models/fluentd/agent_test.rb
okkez Aug 2, 2018
5b88256
Add test/models/fluentd/setting/*_test.rb
okkez Aug 2, 2018
937fc90
Use reactive property properly
okkez Aug 2, 2018
995c5cd
Use Rails.csrfToken() to avoid CSRF error while system test
okkez Aug 2, 2018
789deb6
Add comment for debugging JavaScript error
okkez Aug 2, 2018
33a1df8
Remove needless attribute
okkez Aug 2, 2018
5594baf
Update test/system/source_and_output_test.rb
okkez Aug 2, 2018
74a0591
Add test for restart strategy
okkez Aug 2, 2018
4febcfd
Use capybara-screenshot for integration test
okkez Aug 2, 2018
d2fe02d
Add missing parameters
okkez Aug 3, 2018
a3ea25b
Organize Gemfile for Ruby2.2
okkez Aug 3, 2018
283e4d8
travis: Set chromedriver version
okkez Aug 3, 2018
fab9f77
Use github.com/test-unit/test-unit-rails master HEAD
okkez Aug 8, 2018
0806972
Use test-unit-rails support-system-test-case branch
okkez Aug 8, 2018
c4856db
Download chromedriver before disable net connection
okkez Aug 8, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ group :development, :test do
gem "rake"
gem "pry"
gem "pry-rails"
gem "rspec-rails", "~> 3.0"
gem "test-unit-rails", github: "test-unit/test-unit-rails", branch: "support-system-test-case"
gem "test-unit-notify"
end

group :development do
Expand All @@ -21,10 +22,11 @@ end

group :test do
gem "factory_bot_rails"
gem "capybara", "~> 3.3.1"
gem "capybara", "~> 3.4.2"
gem "capybara-screenshot"
gem "chromedriver-helper"
gem "simplecov", "~> 0.16.1", require: false
gem "webmock", "~> 3.3.0"
gem "timecop"
gem "selenium-webdriver", "~> 3.12.0"
gem "selenium-webdriver", "~> 3.13.1"
end
69 changes: 44 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
GIT
remote: git://github.com/test-unit/test-unit-rails.git
revision: 32adf391ed6e35b55bf21193f0c0556f4bcc7792
branch: support-system-test-case
specs:
test-unit-rails (5.1.4)
rails (>= 5.1.2)
test-unit (>= 3.1.7)
test-unit-activesupport (>= 1.0.8)
test-unit-capybara (>= 1.0.5)
test-unit-rr (>= 1.0.4)

PATH
remote: .
specs:
Expand Down Expand Up @@ -78,6 +90,8 @@ GEM
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
archive-zip (0.11.0)
io-like (~> 0.3.0)
arel (9.0.0)
aws-eventstream (1.0.1)
aws-partitions (1.96.0)
Expand Down Expand Up @@ -108,7 +122,7 @@ GEM
msgpack (~> 1.0)
bson (4.3.0)
builder (3.2.3)
capybara (3.3.1)
capybara (3.4.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
Expand All @@ -120,6 +134,9 @@ GEM
launchy
childprocess (0.9.0)
ffi (~> 1.0, >= 1.0.11)
chromedriver-helper (1.2.0)
archive-zip (~> 0.10)
nokogiri (~> 1.8)
coderay (1.1.2)
concurrent-ruby (1.0.5)
cool.io (1.5.3)
Expand Down Expand Up @@ -155,14 +172,14 @@ GEM
faraday (0.15.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.25)
fluent-plugin-elasticsearch (2.11.1)
fluent-plugin-elasticsearch (2.11.2)
elasticsearch
excon
fluentd (>= 0.14.20)
fluent-plugin-mongo (1.1.2)
fluentd (>= 0.14.12, < 2)
mongo (~> 2.6.0)
fluent-plugin-s3 (1.1.3)
fluent-plugin-s3 (1.1.4)
aws-sdk-s3 (~> 1.0)
aws-sdk-sqs (~> 1.0)
fluentd (>= 0.14.2, < 2)
Expand Down Expand Up @@ -205,6 +222,7 @@ GEM
concurrent-ruby (~> 1.0)
i18n_generators (2.1.1)
rails (>= 3.0.0)
io-like (0.3.0)
jbuilder (2.7.0)
activesupport (>= 4.2.0)
multi_json (>= 1.2)
Expand Down Expand Up @@ -239,6 +257,7 @@ GEM
nio4r (2.3.1)
nokogiri (1.8.4)
mini_portile2 (~> 2.3.0)
power_assert (1.1.3)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
Expand All @@ -249,7 +268,7 @@ GEM
rack (2.0.5)
rack-proxy (0.6.4)
rack
rack-test (1.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.0)
actioncable (= 5.2.0)
Expand Down Expand Up @@ -281,23 +300,7 @@ GEM
ffi (>= 0.5.0, < 2)
request_store (1.4.1)
rack (>= 1.4)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-rails (3.7.2)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.1)
rr (1.2.1)
ruby_dep (1.5.0)
ruby_parser (3.11.0)
sexp_processor (~> 4.9)
Expand All @@ -314,7 +317,7 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
selenium-webdriver (3.12.0)
selenium-webdriver (3.13.1)
childprocess (~> 0.5)
rubyzip (~> 1.2)
serverengine (2.0.7)
Expand All @@ -341,6 +344,20 @@ GEM
httpclient (>= 2.7)
msgpack (>= 0.5.6, < 2)
temple (0.8.0)
test-unit (3.2.8)
power_assert
test-unit-activesupport (1.0.9)
activesupport
test-unit
test-unit-capybara (1.0.6)
capybara (>= 2.1.0)
json
test-unit (>= 2.5.3)
test-unit-notify (1.0.4)
test-unit (>= 2.4.9)
test-unit-rr (1.0.5)
rr (>= 1.1.1)
test-unit (>= 2.5.2)
thor (0.20.0)
thread_safe (0.3.6)
tilt (2.0.8)
Expand Down Expand Up @@ -375,18 +392,20 @@ PLATFORMS
DEPENDENCIES
better_errors
binding_of_caller
capybara (~> 3.3.1)
capybara (~> 3.4.2)
capybara-screenshot
chromedriver-helper
factory_bot_rails
fluentd-ui!
i18n_generators (= 2.1.1)
listen (>= 3.0.5, < 3.2)
pry
pry-rails
rake
rspec-rails (~> 3.0)
selenium-webdriver (~> 3.12.0)
selenium-webdriver (~> 3.13.1)
simplecov (~> 0.16.1)
test-unit-notify
test-unit-rails!
timecop
web-console (~> 3.6)
webmock (~> 3.3.0)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require_relative 'config/application'

Rails.application.load_tasks

Expand Down
25 changes: 18 additions & 7 deletions app/javascript/packs/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,32 @@ import "lodash/lodash";
$(document).ready(() => {
const SettingSection = {
template: "#vue-setting-section",
props: ["id", "content", "type", "name", "arg"],
props: ["initialId", "initialContent", "initialType", "initialName", "initialArg"],
data: function() {
return {
mode: "default",
processing: false
processing: false,
id: null,
content: null,
type: null,
name: null,
arg: null
};
},
created: function() {
this.initialState();
this.id = this.initialId;
this.content = this.initialContent;
this.type = this.initialType;
this.name = this.initialName;
this.arg = this.initialArg;
},
computed: {
endpoint: function() {
return "/api/settings/" + this.id;
},
token: function() {
return Rails.csrfToken();
}
},
methods: {
Expand All @@ -35,7 +48,6 @@ $(document).ready(() => {
this.destroy();
},
onSubmit: function(_event) {
const token = document.getElementsByName("csrf-token")[0].getAttribute("content");
this.processing = true;
this.content = $(`#${this.id} textarea.form-control`)[0].dataset.content;
$.ajax({
Expand All @@ -47,10 +59,10 @@ $(document).ready(() => {
content: this.content
},
headers: {
"X-CSRF-Token": token
"X-CSRF-Token": this.token
}
}).then((data)=> {
_.each(data, function(v,k){
_.each(data, (v, k) => {
this[k] = v;
});
this.initialState();
Expand All @@ -63,7 +75,6 @@ $(document).ready(() => {
this.mode = "default";
},
destroy: function(){
const token = document.getElementsByName("csrf-token")[0].getAttribute("content");
$.ajax({
url: this.endpoint,
method: "POST",
Expand All @@ -72,7 +83,7 @@ $(document).ready(() => {
id: this.id
},
headers: {
"X-CSRF-Token": token
"X-CSRF-Token": this.token
}
}).then(()=> {
this.$parent.update();
Expand Down
22 changes: 12 additions & 10 deletions app/views/fluentd/settings/source_and_output.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@
%p.empty= t('.setting_empty')
%setting-section{"v-if" => "loaded && sections.sources.length > 0",
"v-for" => "source in sections.sources",
"v-bind:id" => "source.id",
"v-bind:content" => "source.content",
"v-bind:type" => "source.type",
"v-bind:name" => "source.name",
"v-bind:arg" => "source.arg"}
"v-bind:key" => "source.id",
"v-bind:initial-id" => "source.id",
"v-bind:initial-content" => "source.content",
"v-bind:initial-type" => "source.type",
"v-bind:initial-name" => "source.name",
"v-bind:initial-arg" => "source.arg"}
.col-xl-6.output
%h3= t('.out')
%div{"v-if" => "loaded && sections.matches.length == 0"}
%p.empty= t('.setting_empty')
%setting-section{"v-if" => "loaded && sections.matches.length > 0",
"v-for" => "match in sections.matches",
"v-bind:id" => "match.id",
"v-bind:content" => "match.content",
"v-bind:type" => "match.type",
"v-bind:name" => "match.name",
"v-bind:arg" => "match.arg"}
"v-bind:key" => "match.id",
"v-bind:initial-id" => "match.id",
"v-bind:initial-content" => "match.content",
"v-bind:initial-type" => "match.type",
"v-bind:initial-name" => "match.name",
"v-bind:initial-arg" => "match.arg"}
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require "action_view/railtie"
# require "action_cable/engine"
require "sprockets/railtie"
# require "rails/test_unit/railtie"
require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Expand Down
3 changes: 2 additions & 1 deletion gemfiles/ruby2.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ group :development, :test do
gem "rake"
gem "pry"
gem "pry-rails"
gem "rspec-rails", "~> 3.0"
gem "test-unit-rails", github: "test-unit/test-unit-rails"
end

group :development do
Expand All @@ -19,6 +19,7 @@ group :test do
gem "factory_bot_rails"
gem "capybara", "~> 3.1.1"
gem "capybara-screenshot"
gem "chromedriver-helper"
gem "simplecov", "~> 0.16.1", require: false
gem "webmock", "~> 3.3.0"
gem "timecop"
Expand Down
Loading