This repository has been archived by the owner on Sep 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vaguely working gem (but totally not)
- Loading branch information
Showing
10 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
source "https://rubygems.org" | ||
|
||
branch = ENV.fetch('SOLIDUS_BRANCH', 'master') | ||
gem "solidus", github: "solidusio/solidus", branch: branch | ||
|
||
gem 'pg' | ||
gem 'mysql2' | ||
|
||
group :development, :test do | ||
gem "pry-rails" | ||
end | ||
|
||
gem 'deface', require: false | ||
|
||
gemspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks | ||
|
||
require 'rspec/core/rake_task' | ||
require 'spree/testing_support/common_rake' | ||
|
||
RSpec::Core::RakeTask.new | ||
|
||
task :default do | ||
if Dir["spec/dummy"].empty? | ||
Rake::Task[:test_app].invoke | ||
Dir.chdir("../../") | ||
end | ||
Rake::Task[:spec].invoke | ||
end | ||
|
||
desc 'Generates a dummy app for testing' | ||
task :test_app do | ||
ENV['LIB_NAME'] = 'solidus_stock_transfers' | ||
Rake::Task['common:test_app'].invoke | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
if ENV['COVERAGE'] | ||
require "simplecov" | ||
SimpleCov.start "rails" | ||
end | ||
|
||
ENV["RAILS_ENV"] ||= "test" | ||
|
||
require File.expand_path("../dummy/config/environment.rb", __FILE__) | ||
|
||
require 'rails-controller-testing' | ||
require 'solidus_support/extension/feature_helper' | ||
|
||
require 'spree/api/testing_support/helpers' | ||
require 'cancan/matchers' | ||
require 'rspec/active_model/mocks' | ||
|
||
Dir[File.join(File.dirname(__FILE__), "support/**/*.rb")].each { |f| require f } | ||
|
||
RSpec.configure do |config| | ||
config.infer_spec_type_from_file_location! | ||
|
||
FactoryBot.find_definitions | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
require 'cancan' | ||
|
||
class DummyAbility | ||
include CanCan::Ability | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
RSpec.shared_examples_for 'a working factory' do | ||
it "builds successfully" do | ||
expect(build(factory)).to be_a(factory_class) | ||
end | ||
|
||
it "creates successfully" do | ||
expect(create(factory)).to be_a(factory_class) | ||
end | ||
|
||
it "is creates a valid record" do | ||
expect(create(factory)).to be_valid | ||
end | ||
end |