Skip to content

Commit aa99e42

Browse files
sashadev-skyjywarren
authored andcommitted
Fix broken tests (#1001)
* 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
1 parent a6413bb commit aa99e42

File tree

7 files changed

+13
-21
lines changed

7 files changed

+13
-21
lines changed

Gemfile

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ end
6666

6767
group :development, :test do
6868
gem 'capybara'
69+
# see https://github.com/SeleniumHQ/selenium/issues/5248
70+
# gem 'webdrivers'
6971
gem 'selenium-webdriver'
7072
gem 'byebug', '~> 11.0.1', platforms: [:mri, :mingw, :x64_mingw]
7173
gem 'faker', '~> 2.2.1'

Gemfile.lock

+1-2
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ DEPENDENCIES
339339
byebug (~> 11.0.1)
340340
capybara
341341
codecov
342-
foreman (~> 0.85.0)
343-
faker (~> 2.1.2)
342+
faker (~> 2.2.1)
344343
friendly_id
345344
geokit-rails (= 1.1.4)
346345
httparty

app/assets/javascripts/mapknitter/core/Class.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ var MapKnitter = {};
66
* See https://github.com/Leaflet/Leaflet/blob/master/src/core/Class.js.
77
*/
88

9-
MapKnitter.Class = function() {};
10-
MapKnitter.Class.extend = function(obj) {
11-
var NewClass = function() {
9+
MapKnitter.Class = function () { };
10+
MapKnitter.Class.extend = function (obj) {
11+
var NewClass = function () {
1212
if (this.initialize) {
1313
this.initialize.apply(this, arguments);
1414
}
1515
};
1616

17-
var F = function() {};
17+
var F = function () { };
1818
F.prototype = this.prototype;
1919

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

3636
return NewClass;
3737
};
38-
MapKnitter.Class.include = function(obj) {
38+
MapKnitter.Class.include = function (obj) {
3939
L.extend(this.prototype, obj);
40-
};
40+
};

app/views/maps/show.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</div>
1818
</div>
1919
<div class="col-md-6">
20-
<a href="/maps/edit/<%= @map.slug %>">
20+
<a href="/maps/<%= @map.slug %>/edit">
2121
<button class="btn btn-outline-info float-right">
2222
<span class="fas fa-pencil-alt"> </span> Edit this map
2323
</button>

test/controllers/front_ui_controller_test.rb

-9
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,4 @@ def teardown
4545
assert !@maps.collect(&:name).include?('Saugus Landfill Incinerator')
4646
assert @maps.collect(&:name).include?('Cubbon Park')
4747
end
48-
49-
test 'view map page' do
50-
map = maps(:saugus)
51-
get :view_map, id: map.slug
52-
53-
assert_response :success
54-
assert assigns(:maps)
55-
assert_template 'front_ui/view_map'
56-
end
5748
end

test/controllers/maps_controller_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def export_anonmymous_map
313313
end
314314

315315
test 'show' do
316-
get :show, id: @map.slug
316+
get :show, params: { id: @map.slug}
317317

318318
assert_response :success
319319
assert assigns(:maps)

test/system/images_test.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def setup
2626
#log in
2727
page.set_rack_session(user_id: @user.id)
2828

29-
visit "/maps/#{@map.slug}"
30-
click_link('Images')
29+
visit "/maps/#{@map.slug}/edit"
30+
click_on 'Images'
3131

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

0 commit comments

Comments
 (0)