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

Move some controller specs to view specs #317

Open
sauloperez opened this issue Feb 1, 2018 · 0 comments
Open

Move some controller specs to view specs #317

sauloperez opened this issue Feb 1, 2018 · 0 comments

Comments

@sauloperez
Copy link
Collaborator

Since view specs have been introduced in #316, we should now turn all the view-like specs that are implemented as controller specs, to proper view specs.

I'm talking about things like:

it 'finds the accountable' do
get :new, params
expect(response.body)
.to include("<a href=\"/members/#{member_giver.user.id}\">#{member_giver.display_name_with_uid}</a>")

which should be turned into something similar to:

it 'links to the accountable' do
   render template: 'transfers/new'
   expect(rendered).to have_link(href: members_path(member))
end

You can take a look at how the first spec was implemented in https://github.com/coopdevs/timeoverflow/pull/316/files#diff-a65080f84f1f83bfbf9866ed561fa58d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants