view · edit · sidebar · attach · print · history

20160808-migrate-davaz-com-fix-feature-tests

<< 20160809-migrate-davaz-com-fix-feature-tests | Index | 20160803-migrate-davaz-com >>


Summary

  • Fix feature tests

Commits / Patches / Pull Requests, Scripts

Index


Fix login redirect issue

At redirect, nextstate is not assigned with zone.

Commits:

Fix require issue at rake test

test fails via Rake.

% bundle exec rake test TEST=test/feature/shop_test.rb                                                 
/path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb:15:in `require': cannot load such file -- /path/to/davaz.com (LoadError)
        from /path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb:15:in `block in <main>'
        from /path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb:4:in `select'
        from /path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!                                                                   
Command failed with status (1): [ruby -I"lib:test" -I"/path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/lib" "/path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb" "test/feature/shop_test.rb" ]
/path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/rake-11.2.2/exe/rake:27:in `<top (required)>'
/usr/local/share/rbenv/versions/2.3.1/bin/bundle:23:in `load'                   
/usr/local/share/rbenv/versions/2.3.1/bin/bundle:23:in `<main>'                    
Tasks: TOP => test                                                                 
(See full trace by running task with --trace)

But it works without rake.

% bundle exec ruby -I.:test test/feature/shop_test.rb
Run options: --seed 61138

# Running:

*

Fabulous run in 5.519638s, 0.1812 runs/s, 0.5435 assertions/s.

1 runs, 3 assertions, 0 failures, 0 errors, 0 skips

Problem was casued by a following violation of ARGV by sbsm.
I've already fixed this issue by this commit (on sbsm).

# lib/sbsm/session.rb
ARGV.push('')

Commits:

Improve test case by wait until

Sometimes feature tests fail, because testing browser proccess can't wait rendering by ajax.
Then I've used Watir::Wait.until and wait_until_present of Watir::Browser instance.

Links:

I made a small helper method wait_until for DaVaz::TestCase module.

Commits:

Fix image uploader

error in SBSM::Session#process: /en/gallery
NameError
uninitialized constant #<Class:DaVaz::Util::ImageHelper>::Image
/path/to/davaz.com/src/util/image_helper.rb:92:in `store_upload_image'
/path/to/davaz.com/src/state/works/rack.rb:64:in `init'
/path/to/sbsm/lib/sbsm/session.rb:362:in `process'
/path/to/sbsm/lib/sbsm/session.rb:166:in `block in drb_process'
/path/to/sbsm/lib/sbsm/session.rb:165:in `synchronize'
error in SBSM::Session#to_html: /en/gallery
NoMethodError
undefined method `artobject_id' for nil:NilClass
/path/to/davaz.com/src/view/_partial/image.rb:26:in `init'
/path/to/davaz.com/.bundle/gems/ruby/2.3.0/gems/htmlgrid-1.1.1/lib/htmlgrid/component.rb:139:in `initialize'
/path/to/sbsm/lib/sbsm/state.rb:245:in `new'
/path/to/sbsm/lib/sbsm/state.rb:245:in `view'
/path/to/sbsm/lib/sbsm/state.rb:181:in `to_html'
/path/to/sbsm/lib/sbsm/session.rb:442:in `to_html'
/path/to/sbsm/lib/sbsm/session.rb:167:in `block in drb_process'
/path/to/sbsm/lib/sbsm/session.rb:165:in `synchronize'
/path/to/sbsm/lib/sbsm/session.rb:165:in `drb_process'
/usr/local/share/rbenv/versions/2.3.1/lib/ruby/2.3.0/drb/drb.rb:1624:in `perform_without_block'
/usr/local/share/rbenv/versions/2.3.1/lib/ruby/2.3.0/drb/drb.rb:1584:in `perform'
/usr/local/share/rbenv/versions/2.3.1/lib/ruby/2.3.0/drb/drb.rb:1657:in `block (2 levels) in main_loop'
/usr/local/share/rbenv/versions/2.3.1/lib/ruby/2.3.0/drb/drb.rb:1653:in `loop'
/usr/local/share/rbenv/versions/2.3.1/lib/ruby/2.3.0/drb/drb.rb:1653:in `block in main_loop'

Commits:

Fix new art object creation

A error (below) will be caused at /en/gallery/new_art_object/ (at new art object creation)

NoMethodError
undefined method `artobject_id' for nil:NilClass

Commits:

Fix tool select option

At admin form (for new artobject), tool select option fetching has still a issue in response.
Fix this tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on August 08, 2016, at 06:15 PM