Skip to content

Commit

Permalink
Fix broken tests (publiclab#1001)
Browse files Browse the repository at this point in the history
* h

* h

* fix broken tests

* fix

* fix click capybara

* add parentheses

* click_on

* fix image placement system test

* put back selenium for travis

* use old driver
  • Loading branch information
sashadev-sky authored and chen-robert committed Dec 5, 2019
1 parent e48dd43 commit f001e30
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ end

group :development, :test do
gem 'capybara'
# see https://github.com/SeleniumHQ/selenium/issues/5248
# gem 'webdrivers'
gem 'selenium-webdriver'
gem 'byebug', '~> 11.0.1', platforms: [:mri, :mingw, :x64_mingw]
gem 'faker', '~> 2.2.1'
Expand Down
3 changes: 1 addition & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ DEPENDENCIES
byebug (~> 11.0.1)
capybara
codecov
foreman (~> 0.85.0)
faker (~> 2.1.2)
faker (~> 2.2.1)
friendly_id
geokit-rails (= 1.1.4)
httparty
Expand Down
12 changes: 6 additions & 6 deletions app/assets/javascripts/mapknitter/core/Class.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ var MapKnitter = {};
* See https://github.com/Leaflet/Leaflet/blob/master/src/core/Class.js.
*/

MapKnitter.Class = function() {};
MapKnitter.Class.extend = function(obj) {
var NewClass = function() {
MapKnitter.Class = function () { };
MapKnitter.Class.extend = function (obj) {
var NewClass = function () {
if (this.initialize) {
this.initialize.apply(this, arguments);
}
};

var F = function() {};
var F = function () { };
F.prototype = this.prototype;

var proto = new F();
Expand All @@ -35,6 +35,6 @@ MapKnitter.Class.extend = function(obj) {

return NewClass;
};
MapKnitter.Class.include = function(obj) {
MapKnitter.Class.include = function (obj) {
L.extend(this.prototype, obj);
};
};
2 changes: 1 addition & 1 deletion app/views/maps/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
</div>
<div class="col-md-6">
<a href="/maps/edit/<%= @map.slug %>">
<a href="/maps/<%= @map.slug %>/edit">
<button class="btn btn-outline-info float-right">
<span class="fas fa-pencil-alt"> </span> Edit this map
</button>
Expand Down
9 changes: 0 additions & 9 deletions test/controllers/front_ui_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,4 @@ def teardown
assert !@maps.collect(&:name).include?('Saugus Landfill Incinerator')
assert @maps.collect(&:name).include?('Cubbon Park')
end

test 'view map page' do
map = maps(:saugus)
get :view_map, id: map.slug

assert_response :success
assert assigns(:maps)
assert_template 'front_ui/view_map'
end
end
2 changes: 1 addition & 1 deletion test/controllers/maps_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def export_anonmymous_map
end

test 'show' do
get :show, id: @map.slug
get :show, params: { id: @map.slug}

assert_response :success
assert assigns(:maps)
Expand Down
4 changes: 2 additions & 2 deletions test/system/images_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ def setup
#log in
page.set_rack_session(user_id: @user.id)

visit "/maps/#{@map.slug}"
click_link('Images')
visit "/maps/#{@map.slug}/edit"
click_on 'Images'

#expect layers to not have an ldi instance before placing
assert !page.evaluate_script(check_if_image_placed)
Expand Down

0 comments on commit f001e30

Please sign in to comment.