tests rubocopified

This commit is contained in:
Christoph Haas 2024-07-15 00:05:56 +02:00
parent 48e3a8c67f
commit 55ea782b86
4 changed files with 26 additions and 14 deletions

View file

@ -1,18 +1,18 @@
require "test_helper"
require 'test_helper'
class AdminControllerTest < ActionController::TestCase
test "user must login" do
test 'user must login' do
get :status
assert_redirected_to user_session_path
end
test "normal user must not see admin status" do
test 'normal user must not see admin status' do
sign_in users(:normal)
get :status
assert_response :forbidden
end
test "admin can see status" do
test 'admin can see status' do
sign_in users(:admin)
get :status
assert_response :success

View file

@ -1,21 +1,25 @@
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require "rails/test_help"
require File.expand_path('../config/environment', __dir__)
require 'rails/test_help'
require "minitest/reporters"
require 'minitest/reporters'
Minitest::Reporters.use!
# require "minitest/rails"
# require "minitest/autorun"
# Uncomment for awesome colorful output
require "minitest/pride"
require 'minitest/pride'
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
fixtures :all
module ActiveSupport
class TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
fixtures :all
end
end
class ActionController::TestCase
include Devise::Test::ControllerHelpers
module ActionController
class TestCase
include Devise::Test::ControllerHelpers
end
end