Skip to content

Commit

Permalink
Chore: Remove controllers specs and gem (TheOdinProject#3008)
Browse files Browse the repository at this point in the history
Because:
* Controller tests are deprecated

This commit:
* Remove rails-controller-testing gem
* Remove spec/controllers
* Fix broken request specs by removing render_template calls
  • Loading branch information
ChargrilledChook committed Jun 26, 2022
1 parent 1d8797e commit d7a1af8
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 161 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ group :test do
gem 'cuprite', '~> 0.13'
gem 'erb_lint', '~> 0.1', require: false
gem 'factory_bot_rails', '~> 6.2'
gem 'rails-controller-testing', '~> 1.0'
gem 'rspec-retry', '~> 0.6'
gem 'shoulda-matchers', '~> 5.1'
gem 'simplecov', '~> 0.21', require: false
Expand Down
5 changes: 0 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ GEM
bundler (>= 1.15.0)
railties (= 6.1.4.6)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand Down Expand Up @@ -587,7 +583,6 @@ DEPENDENCIES
rack-attack (~> 6.6)
rack-mini-profiler
rails (= 6.1.4.6)
rails-controller-testing (~> 1.0)
react-rails (~> 2.6)
rspec-rails (~> 5.1)
rspec-retry (~> 0.6)
Expand Down
10 changes: 0 additions & 10 deletions spec/controllers/errors_controller_spec.rb

This file was deleted.

19 changes: 0 additions & 19 deletions spec/controllers/paths_controller_spec.rb

This file was deleted.

49 changes: 0 additions & 49 deletions spec/controllers/registrations_controller_spec.rb

This file was deleted.

30 changes: 0 additions & 30 deletions spec/controllers/sitemap_controller_spec.rb

This file was deleted.

33 changes: 0 additions & 33 deletions spec/controllers/users_controller_spec.rb

This file was deleted.

2 changes: 1 addition & 1 deletion spec/requests/paths_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

get path_url(path)

expect(response).to render_template(:show)
expect(response).to have_http_status(:ok)
end
end

Expand Down
9 changes: 0 additions & 9 deletions spec/requests/redirects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@

expect(response).to redirect_to('/lessons/test-course-test-lesson')
expect(response).to have_http_status(:moved_permanently)
follow_redirect!

expect(response).to render_template(:show)
end

context "when the course doesn't exist" do
Expand All @@ -33,9 +30,6 @@

expect(response).to redirect_to('/paths')
expect(response).to have_http_status(:moved_permanently)
follow_redirect!

expect(response).to render_template(:index)
end
end

Expand All @@ -47,9 +41,6 @@

expect(response).to redirect_to('/paths')
expect(response).to have_http_status(:moved_permanently)
follow_redirect!

expect(response).to render_template(:index)
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions spec/requests/static_pages_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
get home_path

expect(response).to have_http_status(:ok)
expect(response).to render_template(:home)
end
end

Expand All @@ -15,7 +14,6 @@
get about_path

expect(response).to have_http_status(:ok)
expect(response).to render_template(:about)
end
end

Expand All @@ -24,7 +22,6 @@
get terms_of_use_path

expect(response).to have_http_status(:ok)
expect(response).to render_template(:terms_of_use)
end
end

Expand All @@ -33,7 +30,6 @@
get success_stories_path

expect(response).to have_http_status(:ok)
expect(response).to render_template(:success_stories)
end
end
end

0 comments on commit d7a1af8

Please sign in to comment.