Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

record edit test with rspec #16

wants to merge 6 commits into from

Conversation

raonircl
Copy link
Owner

@raonircl raonircl commented Oct 21, 2022

the task aims to edit a record that already exists in the database,
this task also entails implementing tests using rspec.

@joathan
Copy link
Collaborator

joathan commented Oct 21, 2022

ta editando o banco de dados? corrige o nome da branch por favor.
a descrição do PR, nao condiz com o que foi solicitado na tarefa.

Gemfile Outdated
@@ -32,6 +32,7 @@ group :development, :test do
gem 'rspec-rails'
gem 'pry-rails'
gem 'factory_bot_rails'
gem 'capybara'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

porque instalou o ccapybara?

Copy link
Owner Author

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

Copy link
Collaborator

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.

Comment on lines -1 to -24
# 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

* ...
Copy link
Collaborator

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!


def update
if @user.update(user_params)
render json: @user
Copy link
Collaborator

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]
Copy link
Collaborator

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!

Comment on lines 1 to 9
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

o que é isso?

@@ -1,3 +1,4 @@
require 'capybara/rspec'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

não precisa!

Copy link
Owner Author

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

Copy link
Owner Author

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?

Copy link
Collaborator

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.

@raonircl raonircl linked an issue Oct 21, 2022 that may be closed by this pull request
@raonircl raonircl changed the title db_edit_test record_edit Oct 21, 2022
@joathan
Copy link
Collaborator

joathan commented Oct 21, 2022

o nome da branch continua o mesmo. vc do mudou o nome do PR que inclusive é generico d+

@raonircl raonircl changed the title record_edit record edit test with rspec Oct 21, 2022
Copy link
Collaborator

@joathan joathan left a 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'
Copy link
Collaborator

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.

@@ -1,3 +1,4 @@
require 'capybara/rspec'
Copy link
Collaborator

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.

@raonircl
Copy link
Owner Author

responda as consideraçoes.

O capybara já foi removido do código

@raonircl raonircl closed this Oct 29, 2022
@raonircl raonircl deleted the edit-db branch October 29, 2022 16:25
@raonircl raonircl restored the edit-db branch October 29, 2022 16:30
@raonircl raonircl reopened this Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edição de um registro
2 participants