Fix failing tests
parent
1a1d81cb1c
commit
93d3926663
5
Gemfile
5
Gemfile
|
@ -50,7 +50,8 @@ group :test do
|
|||
gem 'capybara'
|
||||
gem 'launchy' #save_and_open_page while debugging integration tests.
|
||||
gem 'capybara-angular' # Avoid race conditions in angular integration tests
|
||||
gem 'poltergeist'
|
||||
gem 'phantomjs'
|
||||
# gem 'poltergeist'
|
||||
# gem 'phantomjs'
|
||||
gem 'selenium-webdriver'
|
||||
gem 'codeclimate-test-reporter', require: nil
|
||||
end
|
||||
|
|
23
Gemfile.lock
23
Gemfile.lock
|
@ -90,6 +90,8 @@ GEM
|
|||
xpath (~> 2.0)
|
||||
capybara-angular (0.1.0)
|
||||
capybara
|
||||
childprocess (0.5.8)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
chronic (0.10.2)
|
||||
churn (0.0.35)
|
||||
chronic (>= 0.2.3)
|
||||
|
@ -99,7 +101,6 @@ GEM
|
|||
rest-client (>= 1.6.0)
|
||||
ruby_parser (~> 3.0)
|
||||
sexp_processor (~> 4.1)
|
||||
cliver (0.3.2)
|
||||
code_analyzer (0.4.5)
|
||||
sexp_processor
|
||||
code_metrics (0.1.3)
|
||||
|
@ -131,6 +132,7 @@ GEM
|
|||
faker (1.4.3)
|
||||
i18n (~> 0.5)
|
||||
fattr (2.2.2)
|
||||
ffi (1.9.10)
|
||||
flay (2.6.1)
|
||||
ruby_parser (~> 3.0)
|
||||
sexp_processor (~> 4.0)
|
||||
|
@ -198,12 +200,6 @@ GEM
|
|||
parallel (1.4.0)
|
||||
parser (2.2.0.3)
|
||||
ast (>= 1.1, < 3.0)
|
||||
phantomjs (1.9.8.0)
|
||||
poltergeist (1.5.1)
|
||||
capybara (~> 2.1)
|
||||
cliver (~> 0.3.1)
|
||||
multi_json (~> 1.0)
|
||||
websocket-driver (>= 0.2.0)
|
||||
polyglot (0.3.5)
|
||||
procto (0.0.2)
|
||||
pry (0.10.1)
|
||||
|
@ -300,7 +296,13 @@ GEM
|
|||
ruby-progressbar (1.7.1)
|
||||
ruby_parser (3.6.4)
|
||||
sexp_processor (~> 4.1)
|
||||
rubyzip (1.1.7)
|
||||
sass (3.4.12)
|
||||
selenium-webdriver (2.48.1)
|
||||
childprocess (~> 0.5)
|
||||
multi_json (~> 1.0)
|
||||
rubyzip (~> 1.0)
|
||||
websocket (~> 1.0)
|
||||
sexp_processor (4.4.5)
|
||||
simplecov (0.9.2)
|
||||
docile (~> 1.1.0)
|
||||
|
@ -338,9 +340,7 @@ GEM
|
|||
procto (~> 0.0.2)
|
||||
warden (1.2.3)
|
||||
rack (>= 1.0)
|
||||
websocket-driver (0.5.1)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.1)
|
||||
websocket (1.2.2)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
|
@ -365,8 +365,6 @@ DEPENDENCIES
|
|||
mongoid (~> 4.0.0)!
|
||||
mutations
|
||||
ng-rails-csrf
|
||||
phantomjs
|
||||
poltergeist
|
||||
pry
|
||||
rack-cors
|
||||
rails (= 4.1.0)
|
||||
|
@ -382,6 +380,7 @@ DEPENDENCIES
|
|||
rspec
|
||||
rspec-rails
|
||||
sass-rails!
|
||||
selenium-webdriver
|
||||
simplecov
|
||||
smarf_doc!
|
||||
uglifier
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app.png)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
[![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app)
|
||||
[![Code Climate](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/gpa.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
[![Test Coverage](https://codeclimate.com/github/FarmBot/farmbot-web-app/badges/coverage.svg)](https://codeclimate.com/github/FarmBot/farmbot-web-app)
|
||||
[![Build Status](https://travis-ci.org/FarmBot/farmbot-web-app.svg)](https://travis-ci.org/FarmBot/farmbot-web-app)
|
||||
|
||||
# STOP!! You might not need this!
|
||||
|
||||
|
@ -25,7 +25,7 @@ This Repo is the Web based side of FarmBot. It allows users to control the devic
|
|||
0. `rails s`
|
||||
0. Go to `http://localhost:3000`
|
||||
|
||||
The frontend (and asset management) are very much in a transitional state. We're experimenting with Gulp as an alternative
|
||||
The frontend (and asset management) are very much in a transitional state. We're experimenting with Gulp as an alternative
|
||||
|
||||
**We can't fix issues we don't know about.** Please submit an issue if you are having trouble installing on your local machine.
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@ module Api
|
|||
class PlantsController < Api::AbstractController
|
||||
|
||||
def index
|
||||
render json: Plant.where(device: current_device)
|
||||
render json: Plant.where(device_params)
|
||||
end
|
||||
|
||||
def create
|
||||
mutate Plants::Create.run(params, device: current_device)
|
||||
mutate Plants::Create.run(params, device_params)
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
@ -19,6 +19,10 @@ module Api
|
|||
|
||||
private
|
||||
|
||||
def device_params
|
||||
{device: current_device}
|
||||
end
|
||||
|
||||
def plant
|
||||
@plant ||= Plant.find(params[:id])
|
||||
end
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
= stylesheet_link_tag "//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"
|
||||
= stylesheet_link_tag "application"
|
||||
= csrf_meta_tags
|
||||
= javascript_include_tag "//cdnjs.cloudflare.com/ajax/libs/redux/1.0.1/redux.min.js"
|
||||
= javascript_include_tag "//code.jquery.com/jquery-2.1.4.min.js"
|
||||
= javascript_include_tag "//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"
|
||||
= javascript_include_tag "application"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
= render partial: "pages/navbar"
|
||||
.row
|
||||
.col-md-7.col-sm-10.col-sm-centered
|
||||
%br
|
||||
|
|
|
@ -19,7 +19,6 @@ describe 'User Session' do
|
|||
fill_in 'user_email', with: new_email
|
||||
fill_in 'user_current_password', with: user.password
|
||||
click_button 'Update'
|
||||
binding.pry
|
||||
expect(page).to have_content('Your account has been updated successfully.')
|
||||
expect(user.reload.email).to eq(new_email)
|
||||
end
|
||||
|
@ -28,7 +27,6 @@ describe 'User Session' do
|
|||
user = FactoryGirl.create(:user)
|
||||
sign_in_as(user)
|
||||
save_and_open_page
|
||||
binding.pry
|
||||
click_link 'Sign out'
|
||||
expect(page).to have_content('Signed out successfully.')
|
||||
end
|
||||
|
|
|
@ -14,12 +14,12 @@ require 'rspec/rails'
|
|||
require 'capybara/rails'
|
||||
require 'capybara/rspec'
|
||||
require 'features/helpers'
|
||||
require 'capybara/poltergeist'
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
# require 'capybara/poltergeist'
|
||||
# Capybara.javascript_driver = :poltergeist
|
||||
Capybara.register_driver :poltergeist do |app|
|
||||
# Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path)
|
||||
Capybara::Poltergeist::Driver.new(app, timeout: 300)
|
||||
Capybara::Poltergeist::Driver.new(app, js_errors: true)
|
||||
Capybara::Poltergeist::Driver.new(app, phantomjs: Phantomjs.path)
|
||||
end
|
||||
# Requires supporting ruby files with custom matchers and macros, etc, in
|
||||
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
||||
|
|
Loading…
Reference in New Issue