Skip to content

Commit

Permalink
add sample dashboard page
Browse files Browse the repository at this point in the history
  • Loading branch information
ariejan committed Jun 1, 2017
1 parent 749d808 commit 59bfc73
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -13,7 +13,7 @@ gem 'puma', '~> 3.7'

gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'

gem 'haml-rails', '~> 0.9'
gem 'turbolinks', '~> 5'

group :development, :test do
Expand Down
18 changes: 18 additions & 0 deletions Gemfile.lock
Expand Up @@ -72,11 +72,25 @@ GEM
database_cleaner (1.6.1)
diff-lcs (1.3)
erubi (1.6.0)
erubis (2.7.0)
execjs (2.7.0)
ffi (1.9.18)
gherkin (4.1.3)
globalid (0.4.0)
activesupport (>= 4.2.0)
haml (4.0.7)
tilt
haml-rails (0.9.0)
actionpack (>= 4.0.1)
activesupport (>= 4.0.1)
haml (>= 4.0.6, < 5.0)
html2haml (>= 1.0.1)
railties (>= 4.0.1)
html2haml (2.2.0)
erubis (~> 2.7.0)
haml (>= 4.0, < 6)
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
i18n (0.8.4)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
Expand Down Expand Up @@ -148,13 +162,16 @@ GEM
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
ruby_dep (1.5.0)
ruby_parser (3.9.0)
sexp_processor (~> 4.1)
sass (3.4.24)
sass-rails (5.0.6)
railties (>= 4.0.0, < 6)
sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sexp_processor (4.9.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -190,6 +207,7 @@ DEPENDENCIES
byebug
cucumber-rails
database_cleaner
haml-rails (~> 0.9)
listen (>= 3.0.5, < 3.2)
pg (~> 0.18)
puma (~> 3.7)
Expand Down
4 changes: 4 additions & 0 deletions app/controllers/dashboard_controller.rb
@@ -0,0 +1,4 @@
class DashboardController < ApplicationController
def show
end
end
2 changes: 2 additions & 0 deletions app/views/dashboard/show.html.haml
@@ -0,0 +1,2 @@
%h1 Dashboard
%p Nothing to see here, please move along now.
5 changes: 4 additions & 1 deletion config/routes.rb
@@ -1,3 +1,6 @@
Rails.application.routes.draw do
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
get 'dashboard/show'

get 'dashboard', to: 'dashboard#show'
root to: redirect('/dashboard')
end
8 changes: 8 additions & 0 deletions features/dashboard.feature
@@ -0,0 +1,8 @@
Feature:
As a Firefly user
I want to see my dashboard
So I can get a quick overview of what's going on

Scenario: Visit '/'
When I visit the dashboard page
Then I should see the dashboard
4 changes: 4 additions & 0 deletions features/step_definitions/dashboard_steps.rb
@@ -0,0 +1,4 @@
Then(/^I should see the dashboard$/) do
expect(current_path).to eq(dashboard_path)
expect(page).to have_content("Dashboard")
end
3 changes: 3 additions & 0 deletions features/step_definitions/visit_steps.rb
@@ -0,0 +1,3 @@
When(/^I visit the dashboard page$/) do
visit '/'
end
12 changes: 12 additions & 0 deletions spec/controllers/dashboard_controller_spec.rb
@@ -0,0 +1,12 @@
require 'rails_helper'

RSpec.describe DashboardController, type: :controller do

describe "GET #show" do
it "returns http success" do
get :show
expect(response).to have_http_status(:success)
end
end

end

0 comments on commit 59bfc73

Please sign in to comment.