-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
record edit test with rspec #16
base: main
Are you sure you want to change the base?
Conversation
ta editando o banco de dados? corrige o nome da branch por favor. |
Gemfile
Outdated
@@ -32,6 +32,7 @@ group :development, :test do | |||
gem 'rspec-rails' | |||
gem 'pry-rails' | |||
gem 'factory_bot_rails' | |||
gem 'capybara' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
porque instalou o ccapybara?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o teste solicitou a instalação da gem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
não, vc esta fazendo teste de uma api. capybara não é para testes de API.
não precisa dessa gem.
# README | ||
|
||
This README would normally document whatever steps are necessary to get the | ||
application up and running. | ||
# api-postgresql | ||
|
||
Things you may want to cover: | ||
O projeto conta com uma api construida em Ruby on Rails para fins de desenvolvimento e aprendizado. | ||
|
||
* Ruby version | ||
|
||
* System dependencies | ||
The project has an API built in Ruby on Rails for development and learning purposes. | ||
## Tutor | ||
|
||
* Configuration | ||
- [Joathan](https://github.com/joathan) | ||
|
||
* Database creation | ||
## Referência | ||
|
||
* Database initialization | ||
- [RubyGems](https://rubygems.org/) | ||
## 🛠 Habilidades | ||
Ruby on Rails, HTML... | ||
|
||
* How to run the test suite | ||
|
||
* Services (job queues, cache servers, search engines, etc.) | ||
|
||
* Deployment instructions | ||
|
||
* ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isso não faz parte da tarefa!
app/controllers/users_controller.rb
Outdated
|
||
def update | ||
if @user.update(user_params) | ||
render json: @user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
falta retornar o status, assim como vc fez na linha 22 quando houve falhas.
config/routes.rb
Outdated
@@ -1,5 +1,5 @@ | |||
Rails.application.routes.draw do | |||
resources :users, only: [:create] | |||
resources :users, only: [:create, :index, :update] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
index não faz parte da tarefa!
spec/models/user_spec.rb
Outdated
require 'rails_helper' | ||
|
||
RSpec.feature "testing" do | ||
scenario "Checking if everything is working" do | ||
visit 'users' | ||
@user = User.update( name: 'Di ferrero', age: 34 ) | ||
|
||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
o que é isso?
spec/spec_helper.rb
Outdated
@@ -1,3 +1,4 @@ | |||
require 'capybara/rspec' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
não precisa!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ele exige dentro do teste o capybara
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existe algum forma de fazer sem usar a dependência da gem capybara?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existe! não usando capybara!
não precisa dele para fazer testes em API.
o nome da branch continua o mesmo. vc do mudou o nome do PR que inclusive é generico d+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responda as consideraçoes.
Gemfile
Outdated
@@ -32,6 +32,7 @@ group :development, :test do | |||
gem 'rspec-rails' | |||
gem 'pry-rails' | |||
gem 'factory_bot_rails' | |||
gem 'capybara' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
não, vc esta fazendo teste de uma api. capybara não é para testes de API.
não precisa dessa gem.
spec/spec_helper.rb
Outdated
@@ -1,3 +1,4 @@ | |||
require 'capybara/rspec' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
existe! não usando capybara!
não precisa dele para fazer testes em API.
O capybara já foi removido do código |
the task aims to edit a record that already exists in the database,
this task also entails implementing tests using rspec.