Skip to content

1st commit working - 2nd commit is half-finished and needs work on finishing takeaway tests for added menu spec.#2219

Open
david-ewan-campbell wants to merge 2 commits intomakersacademy:mainfrom
david-ewan-campbell:main
Open

1st commit working - 2nd commit is half-finished and needs work on finishing takeaway tests for added menu spec.#2219
david-ewan-campbell wants to merge 2 commits intomakersacademy:mainfrom
david-ewan-campbell:main

Conversation

@david-ewan-campbell
Copy link

@david-ewan-campbell david-ewan-campbell commented Apr 4, 2022

David Campbell

Please write your full name here to make it easier to find your pull request.

User stories

Please list which user stories you've implemented (delete the ones that don't apply).

  • [x ] User story 1: "I would like to see a list of dishes with prices"
  • User story 2: "I would like to be able to select some number of several available dishes"
  • User story 3: "I would like to check that the total I have been given matches the sum of the various dishes in my order"
  • User story 4: "I would like to receive a text such as "Thank you! Your order was placed and will be delivered before 18:52" after I have ordered"

README checklist

Does your README contains instructions for

  • how to install,
  • how to run,
  • and how to test your code?

Here is a pill that can help you write a great README!

@david-ewan-campbell
Copy link
Author

1st commit had takeaway spec/takeaway class working well with doubles after a while and several reviews/revisions of code. Added menu class and ran into problems working independently and making code work - not enough test coverage to menu class from takeaway spec and struggled, running out of time over the weekend but will return to challenge to make it functional and progress with it.

{name: 'Chicken Tikka Masala', price: 6.50},
{name: 'Pilau Rice', price: 2.50},
{name: 'Nan Bread', price: 1.95},
]

Choose a reason for hiding this comment

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

Nice!

end

def list_of_dishes
dishes.map{ |item, price| menu_items <<item[:name]}

Choose a reason for hiding this comment

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

Good :)

@@ -0,0 +1,23 @@
class Menu

attr_accessor :dishes, :menu

Choose a reason for hiding this comment

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

I feel like this could maybe be attr_reader? instead of accessor.
Should :menu be :menu_items?

describe Takeaway do
subject(:takeaway) { described_class.new(menu: menu) }

let(:menu) { double(:menu, display: display_menu) }

Choose a reason for hiding this comment

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

Nice


context 'Menu' do
it 'displays a list of dishes' do
expect(menu.menu_items).to include['Chicken Tikka Masala']

Choose a reason for hiding this comment

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

Maybe could've added some more dishes also

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.

2 participants