module Decidim::Dev
Decidim::Dev
holds all the convenience logic and libraries to be able to create external libraries that create test apps and test themselves against them.
This holds the decidim-dev version.
Public Class Methods
asset(name)
click to toggle source
Public: Finds an asset.
Returns a String with the path for a particular asset.
# File lib/decidim/dev.rb, line 15 def self.asset(name) File.expand_path(File.join(__dir__, "dev", "assets", name)) end
dummy_app_path()
click to toggle source
Public: Get the dummy application path and raises an error if it is not set.
# File lib/decidim/dev.rb, line 39 def self.dummy_app_path unless @dummy_app_path raise StandardError, "Please, add Decidim::Dev::dummy_app_path = File.expand_path(File.join(\"..\", \"spec\", \"decidim_dummy_app\")) to\n your spec helper with the path to the generated dummy app" end @dummy_app_path end
dummy_app_path=(path)
click to toggle source
Public: Sets the dummy application path for testing.
path - A string value defining the path.
# File lib/decidim/dev.rb, line 34 def self.dummy_app_path=(path) @dummy_app_path = path end
install_tasks()
click to toggle source
Public: add rake tasks
# File lib/decidim/dev.rb, line 25 def self.install_tasks Dir[File.join(__dir__, "../tasks/*.rake")].each do |file| load file end end
test_file(filename, content_type)
click to toggle source
Public: Returns a file for testing, just like file fields expect it
# File lib/decidim/dev.rb, line 20 def self.test_file(filename, content_type) Rack::Test::UploadedFile.new(asset(filename), content_type) end
version()
click to toggle source
# File lib/decidim/dev/version.rb, line 6 def self.version "0.24.3" end