Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

assert_select_email fix for 3-0-stable #2918

Merged
merged 3 commits into from Sep 7, 2011

Conversation

Projects
None yet
3 participants
Contributor

akaspick commented Sep 7, 2011

Backport to 3-0-stable of PR #2499

Member

jonleighton commented Sep 7, 2011

Would you mind putting a bit more explanation in the changelog please? I.e. say what was broken. Also, could you do a PR for 3-1-stable as well? (with changelog) Thanks.

Contributor

akaspick commented Sep 7, 2011

Added a longer description to the CHANGELOG... let me know if that's ok and I'll then apply to 3-1

@vijaydev vijaydev commented on the diff Sep 7, 2011

...ck/lib/action_dispatch/testing/assertions/selector.rb
@@ -569,9 +569,9 @@ module ActionDispatch
assert !deliveries.empty?, "No e-mail in delivery list"
for delivery in deliveries
- for part in delivery.parts
+ for part in (delivery.parts.empty? ? [delivery] : delivery.parts)
@vijaydev

vijaydev Sep 7, 2011

Member

can this be split into two lines?

@akaspick

akaspick Sep 7, 2011

Contributor

It could, but this has already been pulled into master with the current style and I don't see much point in deviating from the other branches if it's not really necessary.

I assume you're looking for something like...
parts = delivery.parts.empty? ? [delivery] : delivery.parts
for part in parts...

If this really needs to be changed, then I'll make another commit.

@jonleighton

jonleighton Sep 7, 2011

Member

I agree it would be better assigned to an ivar on a separate line, but I don't find it so offensive that I think it's worth deviating given I already applied to master.

@jonleighton

jonleighton Sep 7, 2011

Member

But please feel free to refactor on master :)

@jonleighton jonleighton added a commit that referenced this pull request Sep 7, 2011

@jonleighton jonleighton Merge pull request #2918 from akaspick/assert_select_email_fix_3_0
assert_select_email fix for 3-0-stable
3a3344a

@jonleighton jonleighton merged commit 3a3344a into rails:3-0-stable Sep 7, 2011

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