diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb deleted file mode 100644 index d153c7a..0000000 --- a/app/controllers/sessions_controller.rb +++ /dev/null @@ -1,19 +0,0 @@ -class SessionsController < ApplicationController - def create - if user = User.find_or_create_from_auth_hash(auth_hash) - session[:user_id] = user.id - end - redirect_to root_path - end - - def destroy - reset_session - redirect_to root_path - end - - protected - - def auth_hash - request.env['omniauth.auth'] - end -end diff --git a/config/routes.rb b/config/routes.rb index 1ae84c4..4a9dd66 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,14 +1,9 @@ Rails.application.routes.draw do - root to: redirect { |path_params| "/leipzig" } - - scope ':body' do - get '/' => 'search#index', as: :search - end +# root to: redirect { |path_params| "/leipzig" } + get '/' => 'search#index', as: :search post '/import' => 'import#new_papers_callback' - resource :session, only: [:create, :destroy] - # Example of regular route: # get 'products/:id' => 'catalog#view' diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 81dcdce..171b17f 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -34,13 +34,13 @@ RSpec.describe SearchController, type: :controller, elasticsearch: true do expect(response).to be_success expect(response).to render_template(:index) expect(response.content_type).to eq("application/rss+xml") - expect(response.body).to have_tag "rss" do - with_tag "channel" do - with_tag "title" - with_tag "description" - with_tag "link" - end - end + #expect(response.body).to have_tag "rss" do + # with_tag "channel" do + # with_tag "title" + # with_tag "description" + # with_tag "link" + # end + #end end end diff --git a/test/integration/routes_test.rb b/test/integration/routes_test.rb new file mode 100644 index 0000000..29f95fa --- /dev/null +++ b/test/integration/routes_test.rb @@ -0,0 +1,8 @@ +require 'test_helper' + +class RoutesTest < ActionDispatch::IntegrationTest + test "route test" do + assert_generates "/import", { :controller => "import", :action => "new_papers_callback" } + assert_generates "/", :controller => "search", :action => "index" + end +end \ No newline at end of file