Skip to content

Owner can view offer#13

Open
boamatule wants to merge 19 commits into
CraftAcademy:developmentfrom
boamatule:owner_can_view_offer
Open

Owner can view offer#13
boamatule wants to merge 19 commits into
CraftAcademy:developmentfrom
boamatule:owner_can_view_offer

Conversation

@boamatule

@boamatule boamatule commented May 9, 2019

Copy link
Copy Markdown
Contributor

PT Story

Changes proposed in this PR:

  • Creates feature test for clicking on the listing & showing offers
  • Adds step definitions to the step's files
  • Generates Offer model with Name, Email, Location & Price attributes
  • Adds Associations between Offer and Listings models
  • Creates Unit test for validating Associations
  • Creates Show view for listing including short info about the Listing & its Offers

What I have learned working on this feature:

  • Refreshed knowledge about Association between models
  • More understanding about rendering model info in the views

Screenshot 2019-05-10 at 09 52 43

Screenshot 2019-05-10 at 09 52 31

boamatule and others added 14 commits May 9, 2019 12:17
…missing step definitions to basic_steps, assertion_steps and object_creation_steps.
…sociation and factory bot for Offer. 2/9 tests green
…r already created listing. Adds step definition for finding 'Show listing' link within the right section, in basic_steps. 5/12 steps green
adds features test for the intervals. Test failing...
…how page for listing. Adds corresponding information in the show view. 16/16 steps green
…tes for Offer model. Adds unit test for validating FactoryBot. Adds validation in Offer model for presence of all attributes, meaning name, email, location, price. All unit tests green
…d show message for the owner. Adds if statement and message in show.haml for listing. 24/24 tests green
@boamatule boamatule changed the title [WIP]Owner can view offer Owner can view offer May 10, 2019
%h2 Offers
- if @listing.offers.any?
- @listing.offers.each do |offer|
.offer{id: dom_id(offer)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Are the elements below supposed to be within the `.offer? div? Check the indentation

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, they are supposed to be nested - and with current indentation they are not.. Changing the indentation now.

Comment thread app/views/listings/show.html.haml Outdated
%p= offer.email
%p= offer.location
%p #{offer.price} kr
%button= link_to "Accept offer", "#"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can't have a link in a button. Hängslen & livrem? 🤪

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah yes :) Changed this to only be a link, to also be more consistent with index page and other links.

Comment thread features/owner_can_view_offer.feature Outdated
| Felix | felix@craft.se | Gothenburg | 100 | Leif |
And I visit the landing page
And I should see "Leif"
And I should see "Show listing" within "Leif" section

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please stop adding assertions to your background steps

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will do. Done

leiter007 and others added 5 commits May 10, 2019 15:32
… on a listing. Changes show.haml for listing to show correct information if no offers exists. Changed indentation for show page paragraphs to be correctly nested inside offers div. Tests 25/25 green
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.

3 participants