Tagged Questions
1
vote
1answer
56 views
Various RSpec tests
I've just written my first full batch of RSpec tests and wondered if anyone can comment at a glance on how they might be written easier, more readable, faster etc. There are some pending specs so ...
0
votes
0answers
39 views
Creating a spec for confirming user accounts
I've created a spec that how a user confirms his account. It tests the following scenarios:
While this code is completely untested (wrote it all in the browser) I don't see why it wouldn't work. ...
3
votes
1answer
282 views
My first controller rspec test
I'm just started learning TDD with Rails and RSpec. This is my first test for controller. Just plain RESTful UserController that responds with JSON, so it has no new and edit methods. Please review it
...
3
votes
2answers
142 views
2
votes
1answer
177 views
How can this rails controller test be cleaner refactored?
I tend to write quite explicit tests for my rails controllers exposing APIs with two seperate concerns:
meeting the defined API-Response with headers headers and the response itself
ensuring the ...
2
votes
1answer
59 views
Using RSpec subject to setup a test
I find myself using subject blocks in my tests to setup example because it is succinct. However is this considered bad form and can it have undesired consequences?
...
2
votes
1answer
95 views
General thoughts on the style of this rspec-rails test
Here's a test from a Rails app I'm working on. I want to know if I'm using describe, let, ...
3
votes
1answer
551 views
Can I improve the way this model RSpec is written?
I'm new to RSpec and testing in general. I've come up with a spec for testing my Content model and I need some feedback 'cause I ...
1
vote
1answer
61 views
4
votes
2answers
5k views
RSpec integration tests for a simple Rails API
The Model is simple. A Player class with three attributes: first_name, last_name, and team_id.
I'm just trying to get a handle on TDD for what will expand into a much more robust API. Below is my ...
1
vote
1answer
732 views
Is the comparing active record result with array of object in rspec test flexible?
Is the test flexible?
...
1
vote
1answer
233 views
How to refactor my controller specs?
In my project (https://github.com/GCorbel/comment-my-projects) I have this kind of code to test my controllers.
...
1
vote
1answer
122 views
Rspec Request break when teammate pushes some changes
This is my rspec integration test for user, it always breaks when my teammate change something, how do i improve this?
...
2
votes
1answer
1k views
Tidying scaffolded Rails controller spec with subject/let
I was just looking at a standard scaffolded Rails controller spec, and tried to get it to use subject or let blocks, and failed miserably ... can subject or let tidy controller specs the same as it ...