Skip to content
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

Add project improvements #197

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
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
8 changes: 7 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ GEM
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 Down Expand Up @@ -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 Down Expand Up @@ -429,6 +434,7 @@ PLATFORMS

DEPENDENCIES
capybara
capybara-screenshot
connection_pool
danger
danger-rubocop
Expand Down Expand Up @@ -458,7 +464,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 @@ -47,7 +47,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 @@ -59,30 +59,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', first_pr: true) }
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