factory_bot_rails
rack-test
factory_bot_rails | rack-test | |
---|---|---|
8 | 2 | |
3,036 | 916 | |
0.2% | 0.0% | |
7.1 | 3.9 | |
about 1 month ago | about 1 month ago | |
Gherkin | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
factory_bot_rails
-
Test Driving a Rails API - Part Two
While we’re at it, let's add a couple of other gems we’ll need for our test environment: factory_bot_rails is a fixtures replacement and generates test model instances. faker is handy for generating fake strings of data to be used in tests. Add those gems to the development and test group of your Gemfile:
-
How to Use Shoulda Matchers with RSpec for Ruby on Rails
Factory Bot Rails
-
How to Setup RSpec on a Rails Project
rspec-rails factory_bot_rails faker
-
factory_bot_rails_seeder: a gem to mass generate factories for your models
Hey all, just published a simple gem to mass generate FactoryBot factories for existing projects. Someone had this issue on GitHub (https://github.com/thoughtbot/factory_bot_rails/issues/404). I failed to build it in a nice way within the main gem, but wanted to get a solution out there for people who might be in need. I had to get some legacy codebases up to speed in the past, and this would have been useful. Cheers! https://github.com/FanaHOVA/factory_bot_rails_seeder
-
ActiveStorage, Ruby on Rails 7, GraphQL and RSpec
I use FactoryBot for creating the factory, for stubbing the factory. My factory is containing an image that has to be uploaded and attached as doc every time a factory created:
-
It really be like that though
Here is some real Gherkin from the Factory Bot Rails gem source code on GitHub:
- Como configurar ambiente de testes em Ruby on Rails com RSpec
-
10 Signs of a good Ruby on Rails Developer
If your are using gems like faker , factory_bot_rails and database_cleaner to create and clean test records then creating unnecessary records can cost you time and speed.
rack-test
-
Test Driving a Rails API - Part Two
In this part, we’ll set up our testing environment so that we can test our Rails API using minitest with minitest/spec. We’ll look at the differences between traditional style unit tests and spec-style tests, or specs. I’ll demonstrate why you should use minitest-rails. We’ll look at using rack-test for testing our API. We’ll even create our own generator to generate API specs.
-
Application-as-a-Function Thinking
The "app-as-function" has some very concrete applications though, even outside languages like Haskell. The [rack-test](https://github.com/rack/rack-test) gem (and similar languages) work exactly like this: they run the "app" part without the "web server" part to enable much easier testing. Rack middlewares similarly treat the enclosed app as just a function taking some specified input and returning some output value.
What are some alternatives?
faker - A library for generating fake data such as names, addresses, and phone numbers. [Moved to: https://github.com/faker-ruby/faker]
timecop - A gem providing "time travel", "time freezing", and "time acceleration" capabilities, making it simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.
Whenever - Cron jobs in Ruby
http4k - The Functional toolkit for Kotlin HTTP applications. http4k provides a simple and uniform way to serve, consume, and test HTTP services.
rspec-rails - RSpec for Rails 6+
minitest-rails - Minitest integration for Rails
SimpleCov - Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites
gf-core - Grammatical Framework core: compiler, shell & runtimes
rubocop - A Ruby static code analyzer and formatter, based on the community Ruby style guide. [Moved to: https://github.com/rubocop/rubocop]
shoulda-matchers - Simple one-liner tests for common Rails functionality
terraform-provider-rollbar - Terraform provider for Rollbar
BrainFuck-SQL - BrainFuck Interpreter in SQL