diff --git a/.gitignore b/.gitignore index b6c61df..a9b8829 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.rbenv-gemsets + Gemfile.lock # Ignore bundler config. diff --git a/app/assets/javascripts/welcome.js.coffee b/app/assets/javascripts/welcome.js.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/welcome.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/welcome.css.scss b/app/assets/stylesheets/welcome.css.scss new file mode 100644 index 0000000..77ce11a --- /dev/null +++ b/app/assets/stylesheets/welcome.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the welcome controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb new file mode 100644 index 0000000..f9b859b --- /dev/null +++ b/app/controllers/welcome_controller.rb @@ -0,0 +1,4 @@ +class WelcomeController < ApplicationController + def index + end +end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb new file mode 100644 index 0000000..df00684 --- /dev/null +++ b/app/helpers/welcome_helper.rb @@ -0,0 +1,5 @@ +module WelcomeHelper + def title + "PecaUploader - Welcome !!" + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 206d69c..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - - - - PecaUploader - <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> - <%= javascript_include_tag "application", "data-turbolinks-track" => true %> - <%= csrf_meta_tags %> - - - -<%= yield %> - - - diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml new file mode 100644 index 0000000..0819df2 --- /dev/null +++ b/app/views/layouts/application.html.haml @@ -0,0 +1,9 @@ +!!! +%html + %head + %title= title ? title : "PecaUploader" + = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true + = javascript_include_tag "application", "data-turbolinks-track" => true + = csrf_meta_tags + %body + = yield diff --git a/app/views/welcome/index.html.haml b/app/views/welcome/index.html.haml new file mode 100644 index 0000000..ff40915 --- /dev/null +++ b/app/views/welcome/index.html.haml @@ -0,0 +1,3 @@ +%ul + %li Top Rate + %li Today diff --git a/config/routes.rb b/config/routes.rb index baba919..edd0a68 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,56 +1,3 @@ PecaUploader::Application.routes.draw do - # The priority is based upon order of creation: first created -> highest priority. - # See how all your routes lay out with "rake routes". - - # You can have the root of your site routed with "root" - # root 'welcome#index' - - # Example of regular route: - # get 'products/:id' => 'catalog#view' - - # Example of named route that can be invoked with purchase_url(id: product.id) - # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase - - # Example resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Example resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Example resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Example resource route with more complex sub-resources: - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', on: :collection - # end - # end - - # Example resource route with concerns: - # concern :toggleable do - # post 'toggle' - # end - # resources :posts, concerns: :toggleable - # resources :photos, concerns: :toggleable - - # Example resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end + root "welcome#index" end diff --git a/spec/controllers/welcome_controller_spec.rb b/spec/controllers/welcome_controller_spec.rb new file mode 100644 index 0000000..65e084e --- /dev/null +++ b/spec/controllers/welcome_controller_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe WelcomeController do + describe "GET 'index'" do + before { get :index } + it { response.should be_success } + end +end diff --git a/spec/features/welcome/index.html.haml_spec.rb b/spec/features/welcome/index.html.haml_spec.rb new file mode 100644 index 0000000..335621f --- /dev/null +++ b/spec/features/welcome/index.html.haml_spec.rb @@ -0,0 +1,9 @@ +require 'spec_helper' + +describe "visit /" do + before { visit '/' } + + it { expect(page).to have_title("PecaUploader - Welcome !!") } + it { expect(page).to have_content('Top Rate') } + it { expect(page).to have_content('Today') } +end diff --git a/spec/helpers/welcome_helper_spec.rb b/spec/helpers/welcome_helper_spec.rb new file mode 100644 index 0000000..9d7f12b --- /dev/null +++ b/spec/helpers/welcome_helper_spec.rb @@ -0,0 +1,8 @@ +require 'spec_helper' + +describe WelcomeHelper do + describe "#title" do + subject { helper.title } + it { expect(subject).to eql "PecaUploader - Welcome !!" } + end +end