Skip to content

Add project improvements #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/public/assets*
/public/*
/Gemfile.lock
/tmp
/node_modules
/coverage
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ group :development do

# gem 'hanami-scaffold', github: 'davydovanton/hanami-scaffold'

gem 'rack-mini-profiler', require: false
gem 'rack-mini-profiler', '0.9.9', require: false
gem 'memory_profiler'
end

Expand All @@ -72,6 +72,7 @@ group :test do
gem 'rspec'
gem 'rspec-hanami', github: 'davydovanton/rspec-hanami'
gem 'capybara'
gem 'capybara-screenshot'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why we need this gem? :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davydovanton It's simplify debugging for feature tests

gem 'poltergeist'
gem 'simplecov', require: false
gem 'simplecov-json', require: false
Expand Down
79 changes: 43 additions & 36 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,16 @@ GEM
ast (2.3.0)
buftok (0.2.0)
byebug (9.1.0)
capybara (2.15.4)
capybara (2.16.1)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
capybara-screenshot (1.0.18)
capybara (>= 1.0, < 3)
launchy
claide (1.0.2)
claide-plugins (0.9.2)
cork
Expand All @@ -68,7 +71,7 @@ GEM
colored2 (~> 3.1)
crack (0.4.3)
safe_yaml (~> 1.0.0)
danger (5.5.4)
danger (5.5.5)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
Expand Down Expand Up @@ -109,8 +112,8 @@ GEM
dry-core (~> 0.2)
dry-equalizer (~> 0.2)
dry-matcher (0.6.0)
dry-monads (0.3.1)
dry-core
dry-monads (0.4.0)
dry-core (~> 0.3, >= 0.3.3)
dry-equalizer
dry-struct (0.3.1)
dry-configurable (~> 0.1)
Expand Down Expand Up @@ -148,7 +151,7 @@ GEM
fabrication (2.18.0)
faker (1.8.4)
i18n (~> 0.5)
faraday (0.11.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
Expand All @@ -173,13 +176,13 @@ GEM
hanami-cli (0.1.0)
concurrent-ruby (~> 1.0)
hanami-utils (~> 1.1)
hanami-controller (1.1.0)
hanami-controller (1.1.1)
hanami-utils (~> 1.1)
rack (~> 2.0)
hanami-fabrication (0.1.0)
fabrication (~> 2.16)
hanami-utils (< 2.0)
hanami-helpers (1.1.0)
hanami-helpers (1.1.1)
hanami-utils (~> 1.1)
hanami-mailer (1.1.0)
hanami-utils (~> 1.1)
Expand All @@ -196,7 +199,7 @@ GEM
hanami-utils (~> 1.1)
http_router (= 0.11.2)
rack (~> 2.0)
hanami-utils (1.1.0)
hanami-utils (1.1.1)
concurrent-ruby (~> 1.0)
transproc (~> 1.0)
hanami-validations (1.1.0)
Expand All @@ -208,14 +211,14 @@ GEM
hashdiff (0.3.7)
hashie (3.5.6)
hiredis (0.6.1)
http (2.2.2)
http (3.0.0)
addressable (~> 2.3)
http-cookie (~> 1.0)
http-form_data (~> 1.0.1)
http-form_data (>= 2.0.0.pre.pre2, < 3)
http_parser.rb (~> 0.6.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (1.0.3)
http-form_data (2.0.0)
http_parser.rb (0.6.0)
http_router (0.11.2)
rack (>= 1.0.0)
Expand All @@ -227,6 +230,8 @@ GEM
json (2.1.0)
jwt (1.5.6)
kramdown (1.13.1)
launchy (2.4.3)
addressable (~> 2.3)
letsencrypt_heroku (0.2.14)
acme-client
rainbow
Expand All @@ -247,7 +252,7 @@ GEM
multipart-post (2.0.0)
nap (1.1.0)
naught (1.1.0)
newrelic_rpm (4.5.0.337)
newrelic_rpm (4.6.0.338)
no_proxy_fix (0.1.2)
nokogiri (1.8.1)
mini_portile2 (~> 2.3.0)
Expand All @@ -267,38 +272,38 @@ GEM
omniauth (~> 1.2)
open4 (1.3.4)
parallel (1.12.0)
parser (2.4.0.0)
ast (~> 2.2)
parser (2.4.0.2)
ast (~> 2.3)
pg (0.21.0)
poltergeist (1.16.0)
capybara (~> 2.1)
cliver (~> 0.3.1)
websocket-driver (>= 0.2.0)
powerpack (0.1.1)
pry (0.11.2)
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.5.0)
pry-byebug (3.5.1)
byebug (~> 9.1)
pry (~> 0.10)
public_suffix (3.0.0)
puma (3.10.0)
public_suffix (3.0.1)
puma (3.11.0)
rack (2.0.3)
rack-mini-profiler (0.10.6)
rack-mini-profiler (0.9.9)
rack (>= 1.2.0)
rack-protection (2.0.0)
rack
rack-test (0.7.0)
rack-test (0.8.2)
rack (>= 1.0, < 3)
rainbow (2.2.2)
rake
rake (12.2.1)
rake (12.3.0)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
redis (3.3.5)
relative_time (1.0.0)
rinku (2.0.3)
rinku (2.0.4)
rom (3.3.3)
concurrent-ruby (~> 1.0)
dry-core (~> 0.3)
Expand Down Expand Up @@ -356,7 +361,7 @@ GEM
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
secure_headers (5.0.1)
secure_headers (5.0.3)
useragent (>= 0.15.0)
sequel (4.49.0)
shotgun (0.9.2)
Expand All @@ -380,10 +385,10 @@ GEM
simplecov-json (0.2)
json
simplecov
slim (3.0.8)
slim (3.0.9)
temple (>= 0.7.6, < 0.9)
tilt (>= 1.3.3, < 2.1)
slop (4.6.0)
slop (4.6.1)
temple (0.8.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
Expand All @@ -394,16 +399,17 @@ GEM
tty-cursor (0.5.0)
tty-spinner (0.7.0)
tty-cursor (>= 0.5.0)
twitter (6.1.0)
addressable (~> 2.5)
twitter (6.2.0)
addressable (~> 2.3)
buftok (~> 0.2.0)
equalizer (= 0.0.11)
faraday (~> 0.11.0)
http (~> 2.1)
equalizer (~> 0.0.11)
http (~> 3.0)
http-form_data (~> 2.0)
http_parser.rb (~> 0.6.0)
memoizable (~> 0.4.2)
naught (~> 1.1)
simple_oauth (~> 0.3.1)
memoizable (~> 0.4.0)
multipart-post (~> 2.0)
naught (~> 1.0)
simple_oauth (~> 0.3.0)
tzinfo (1.2.4)
thread_safe (~> 0.1)
unf (0.1.4)
Expand All @@ -414,13 +420,13 @@ GEM
rack
useragent (0.16.8)
vcr (3.0.3)
webmock (3.1.0)
webmock (3.1.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.2)
websocket-extensions (0.1.3)
xpath (2.1.0)
nokogiri (~> 1.3)

Expand All @@ -429,6 +435,7 @@ PLATFORMS

DEPENDENCIES
capybara
capybara-screenshot
connection_pool
danger
danger-rubocop
Expand Down Expand Up @@ -458,7 +465,7 @@ DEPENDENCIES
pry
pry-byebug
puma
rack-mini-profiler
rack-mini-profiler (= 0.9.9)
rake
redis (~> 3.2)
relative_time
Expand Down
1 change: 1 addition & 0 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ if Hanami.env?(:development)
Rack::MiniProfiler.config.disable_caching = false
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::FileStore
Rack::MiniProfiler.config.storage_options = { path: './tmp' }

Rack::MiniProfiler.profile_method(Hanami::View::Rendering::Partial, :render) { "Render partial #{@options[:partial]}" }

use Rack::MiniProfiler
Expand Down
4 changes: 3 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

require 'simplecov'
require 'simplecov-json'
require "support/database_cleaner"
require 'support/database_cleaner'

SimpleCov.formatters = [
SimpleCov::Formatter::HTMLFormatter,
Expand Down Expand Up @@ -36,6 +36,8 @@
end

require 'rspec/hanami'
require 'capybara-screenshot/rspec'

require 'sidekiq/testing'
Sidekiq::Testing.fake!

Expand Down
13 changes: 6 additions & 7 deletions spec/web/features/tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def expect_task(task)

end

RSpec.describe 'Tasks page', type: :feature, js: true do
RSpec.describe 'Tasks page', type: :feature do

include TasksPageHelper

Expand All @@ -57,30 +57,29 @@ def expect_task(task)
let!(:finished_task) { Fabricate.create(:task, user_id: Fabricate.create(:user).id, approved: true, status: 'done', time_estimate: 'more than month', comlexity: 'easy') }
let(:repo) { UserRepository.new }

before(:each) { visit '/tasks' }

it 'status filter in default position "Open"' do
visit '/tasks'
expect_task(open_task)
end

it 'status filter in position "Assigned"' do
find('#task-status-select').select 'Assigned'
visit '/tasks?status=assigned'
expect_task(assigned_task)
end

it 'status filter in position "Closed"' do
find('#task-status-select').select 'Closed'
visit '/tasks?status=closed'
expect_task(closed_task)
end

it 'status filter in position "Finished"' do
find('#task-status-select').select 'Finished'
visit '/tasks?status=done'
expect_task(finished_task)
end

end

describe '#new' do
describe '#new', js: true do

before(:each) { visit '/tasks/new' }

Expand Down