我正在使用Rails 4.2和Ruby 2.2以及rspec作为测试用例.我已经设定
Rails.env = 'test'
Run Code Online (Sandbox Code Playgroud)
在我的spec_helper和rails_helper中.这是我的database.yml文件:
development:
adapter: postgresql
encoding: unicode
database: app_dev
pool: 5
username: postgres
password: root
test:
adapter: postgresql
encoding: unicode
database: app_test
pool: 5
username: postgres
password: root
production:
adapter: postgresql
encoding: unicode
database: app_prod
pool: 5
username: postgres
password: root
Run Code Online (Sandbox Code Playgroud)
这是我的rails_helper:
Rails.env = 'test'
require 'spec_helper'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
config.include JsonHelper
config.include PathHelper
config.include S3Helper
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_spec_type_from_file_location! …
Run Code Online (Sandbox Code Playgroud) 我使用activeadmin 0.4.4以及rails3-jquery-autocomplete 1.0.15.
我能够在一个字段中添加自动完成功能.下拉列表显示完全符合要求.
但是,我无法从下拉列表中选择一个值.(如果我手动在文本字段中写入值,它可以正常工作).我在浏览器控制台中收到此错误,我无法弄清楚如何继续这个:
Uncaught TypeError: undefined is not a function
t.railsAutocomplete.fn.extend.init.t.autocomplete.select -- active_adimn.js line 13982
Run Code Online (Sandbox Code Playgroud)
请建议.