-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from cre-ne-jp/message-models
メッセージの記録と表示
- Loading branch information
Showing
89 changed files
with
2,886 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# vim: filetype=ruby | ||
|
||
guard :minitest, spring: true, all_on_start: false do | ||
watch(%r{^test/(.*)/?(.*)_test\.rb$}) | ||
watch('test/test_helper.rb') { 'test' } | ||
watch('config/routes.rb') { integration_tests } | ||
watch(%r{^app/models/(.*?)\.rb$}) do |matches| | ||
"test/models/#{matches[1]}_test.rb" | ||
end | ||
watch(%r{^app/controllers/(.*?)_controller\.rb$}) do |matches| | ||
resource_tests(matches[1]) | ||
end | ||
watch(%r{^app/views/([^/]*?)/.*\.html\.erb$}) do |matches| | ||
["test/controllers/#{matches[1]}_controller_test.rb"] + | ||
integration_tests(matches[1]) | ||
end | ||
watch(%r{^app/helpers/(.*?)_helper\.rb$}) do |matches| | ||
integration_tests(matches[1]) | ||
end | ||
watch('app/views/layouts/application.html.erb') do | ||
'test/integration/site_layout_test.rb' | ||
end | ||
watch('app/helpers/sessions_helper.rb') do | ||
integration_tests << 'test/helpers/sessions_helper_test.rb' | ||
end | ||
watch('app/controllers/sessions_controller.rb') do | ||
['test/controllers/sessions_controller_test.rb', | ||
'test/integration/users_login_test.rb'] | ||
end | ||
watch('app/controllers/account_activations_controller.rb') do | ||
'test/integration/users_signup_test.rb' | ||
end | ||
watch(%r{app/views/users/*}) do | ||
resource_tests('users') + | ||
['test/integration/microposts_interface_test.rb'] | ||
end | ||
end | ||
|
||
# Returns the integration tests corresponding to the given resource. | ||
def integration_tests(resource = :all) | ||
if resource == :all | ||
Dir["test/integration/*"] | ||
else | ||
Dir["test/integration/#{resource}_*.rb"] | ||
end | ||
end | ||
|
||
# Returns the controller tests corresponding to the given resource. | ||
def controller_test(resource) | ||
"test/controllers/#{resource}_controller_test.rb" | ||
end | ||
|
||
# Returns all tests for the given resource. | ||
def resource_tests(resource) | ||
integration_tests(resource) << controller_test(resource) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.