Sha256: 8d70e78856be358e545b2557e850e73580820fb2087e1614ac665397d347cd15

Contents?: true

Size: 1.13 KB

Versions: 13

Compression:

Stored size: 1.13 KB

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe RailsWebCache::KeysController, type: :controller do
  routes { RailsWebCache::Engine.routes }

  describe 'GET #index' do
    it 'returns a success response' do
      Rails.cache.write('RailsWebCache', 'RailsWebCache')
      get :index
      expect(response).to be_successful
      get :index, params: { query: 'Search' }
      expect(response).to be_successful
    end
  end

  describe 'GET #show' do
    it 'returns a success response' do
      Rails.cache.write('RailsWebCache', 'RailsWebCache')
      get :show, params: { key: 'RailsWebCache' }
      expect(response).to be_successful
    end
  end

  describe 'GET #destroy' do
    it 'returns a success response' do
      Rails.cache.write('RailsWebCache', 'RailsWebCache')
      get :destroy, params: { key: 'RailsWebCache' }
      expect(response).to be_redirect
    end
  end

  describe 'GET #destroy_all' do
    it 'returns a success response' do
      Rails.cache.write('RailsWebCache', 'RailsWebCache')
      get :destroy_all, params: { keys: ['RailsWebCache'] }
      expect(response).to be_redirect
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rails_web_cache-0.7.6 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.7.5 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.7.4 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.7.3 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.7.2 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.7.0 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.6.1 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.6.0 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.5.0 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.4.0 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.3.0 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.2.0 spec/controllers/keys_controller_spec.rb
rails_web_cache-0.1.0 spec/controllers/keys_controller_spec.rb