SB Apprenticeship: Day 58

AAAAAAAAHHHHHHH IT WORKS!!!

AAAAAAAAHHHHHHH IT WORKS!!!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

So…I finally got Stripe working! That was my triumph of the week. Annie had to help me track down a bizarre little bug that was changing my total price to an integer and chopping off the cents that I am absolutely positive that I would never have figured out on my own — all it was saying was that I couldn’t have a charge of less than 50 cents, regardless of the actual total. I thought that it just wasn’t seeing the total, so I fought with that for a while, but Annie realized that if my total was more than $50 I wasn’t getting the error message. My cart had just been so full from my tests that I hadn’t noticed the bug.

I also got emails working!

I also got emails working!

Not only did I get Stripe working, but I managed to get the email to work, too! I practically went on a high-fiving tour of the office at the end of the day.

Today I have a few more things to do to satisfy the Cucumber suite.

  • After you hit ‘Place order’ on the checkout page, you’re supposed to be shown an order total to review before hitting the final ‘Confirm’ button to send the order.
  • After the final confirmation you’re supposed to be shown an order summary
  • Your credit card should be saved for future purchases
  • If you make another order you should be asked if you want to use your saved credit card

I think these will be relatively easy to implement, but with my track record, who knows. I’m pretty sure that it’ll just be a new page to show everything, but I don’t know how to get Stripe to save a credit card, so that may be a challenge.

Advertisements

SB Apprenticeship: Day 56

Lookit all those passing tests!

Lookit all those passing tests!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

If this bookstore project has done one thing for my Ruby knowledge, it has made me completely unafraid of migrations. I guess ‘afraid’ is the wrong word, I was just under the impression that they were more significant than they are, like you should only make additional migrations in rare circumstances. Otherwise you should just be able to work around it. Obviously I was pretty wrong there. 🙂

I was able to fix the UnknownFormat error from yesterday, turns out my method was such a mess that it wasn’t even getting to the line where I declared the format. Josh helped prod me in the right direction, and it was on to the next error message! Which is still Stripe error while creating customer: Must provide source or customer. Sigh. Yesterday was Brandon’s day to work from home, but he was able to help me a bit over Slack, and said that he would help me more when we pair today. Since I wasn’t having any success fixing that I decided to work on the Cucumber tests so I wouldn’t be too far behind. I got a lot of them done, until I ran into the test that needs Stripe to work. But getting so many of them done was a relief, since I feel more caught up. Most of the tests that are left are somewhat repetitive, so as soon as we get Stripe working I should be able to fly through them.

Today I’m going to hopefully get the Stripe stuff worked through with Brandon. The documentation stuff for Stripe is good, but it’s not particularly newbie friendly — I don’t actually know where some of the code it gives you goes, for instance. Yet another thing to add to my increasing list of newbie tutorials I should do.

Yesterday Brandon said he was going to show me how to use the element inspector to view the details of network requests, so I can see the data that I’m passing to the Stripe API. I’m looking forward to that; I like learning the little tips and tricks to figure out what’s going on almost more than I enjoy learning to code in general. I also need to make some adjustments to my project based on the tests, one wants an order summary page and another says I should be able to adjust the quantity of books in my cart. So let’s see, today’s todo list is:

  • Figure out why Stripe isn’t seeing my customer
  • Add a summary page
  • Figure out the damned quantity thing
  • Finish Cucumber tests

I expect to learn to how to make the Stripe API talk to my code correctly, and hopefully how to adjust the quantity in my cart. I worked on that for a couple days, until Brandon told me that it wasn’t actually part of the requirements for the project and I didn’t have to do it, which made me happy, because it was way harder than I expected it to be.

SB Apprenticeship: Day 45

Now it's prettier! And paginated!

Now it’s prettier! And paginated!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

David’s begun his pairing tour! He’s leaving meeeeeeeeeee! Heh. No, seriously, he finished the bookstore app and is now embarking on a tour to pair with a bunch of people around the office. I’m a bit behind on my bookstore app; which makes me a little sad. We’d been pretty much neck and neck for the first part of the apprenticeship. I’m very curious what a pairing tour entails, though, so I can get the scoop before I start mine. Good luck, David!

Friday Brandon and I paired and worked on some styling for my bookstore. I learned about Bootstrap, a front-end framework that makes styling a whole bunch easier. We didn’t learn it at TIY because Mason said that has been overused in recent years and you can super tell when something has been Bootstrapped, but for these purposes, Brandon said it was fine. No one besides him is going to even see the bookstore app.

Today I am going to hopefully finish the book index page feature and move on to setting up email. I’m going to the gym at noon and have a blog meeting at 2:30, though, so hopefully that doesn’t throw me off track. This is a relatively short feature, so here’s hoping it goes quickly!

I expect to learn how to get the pagination gem working! I thought it was, but that test is listed as pending, so I guess it didn’t? Sigh.

SB Apprenticeship: Day 41

Today is voting day for municipal primaries! If you're in NC, check the Board of Elections to see if there's one going on in your town!

Today is voting day for municipal primaries! If you’re in NC, check the Board of Elections to see if there’s one going on in your town!

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Yesterday I learned that apparently it’s impossible to confirm that a modal dialogue exists using Capybara-Webkit. When I look online, I find ways to accept or dismiss the alert, which in theory ought to work also: if you can confirm an alert than the alert obviously exists, but when I try I just get Unable to find modal dialog (Capybara::ModalNotFound). I was originally supposed to use Selenium for this, but Brandon suggested Webkit instead, and I’m beginning to think he did it solely to troll me. Of course, when he gets in and I manage to corner him for help, it’s going to be like three words that he just knows off the top of his head. *sigh* I’m getting a lot of use out of the ¯\_(ツ)_/¯ emoji lately.

Today I am going to fight with this stupid JavaScript stuff some more. After I get that working, there’s only one more Scenario in the Administration feature, so that’ll be a nice accomplishment. I just realized that I never actually did the blog kata that I was supposed to work on, so I may take time this afternoon and work on that instead.

With any luck I’ll learn that I was looking in the wrong place for the answers to my Webkit problems, and Brandon will show me a magical resource that will answer all my questions, leaving me content and happy at my keyboard. What do we think the chances of that actually happening are?

SB Apprenticeship: Day 40

Hurricane Joaquin made this weekend wet, but fortunately not exciting.

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

I really need to start remembering to write these up on Friday so I don’t have all weekend to forget what I did. Let’s see…Friday I worked on my bookstore app basically all day, with a break for a Smashing Labs update and a Cucumber lunch ‘n Learn. I’m definitely understanding stuff more, although I still make stupid mistakes. “Why isn’t my database showing up?” “Well, did you make a database?” “Uhhhhh…..” And it seems like it’s always like that. Ah well. At least I’m seeing improvement, right?

Today is more bookstore! The next part of the cucumber tests involve JavaScript, so I’ll have to brush off those skills.

I expect to learn more about how to make this bookstore work!

SB Apprenticeship: Day 39

My coworkers have a Minecraft world they play in, so I finally got motivated to try it out. Four hours later, this is my house!

My coworkers have a Minecraft world they play in, so I finally got motivated to try it out. Four hours later, this is my house!

I’m not a gamer. I never have been, for a lot of reasons — I never played as a kid, I don’t have any consoles, I’m kind of super ADD, I never really knew what to play, so many games have a reputation for being horrifically sexist…etc. The games I’ve enjoyed have all been puzzle games, like Portal or Braid or Thomas Was Alone. I’ve been curious about sandbox games like Minecraft or The Sims for a while now, but I know myself — it’s all or nothing. Like last night, for instance, I started playing and the next thing I know it’s midnight and I really ought to be getting ready for bed — but I just finished smelting all this glass, I need to make my house have windows! I didn’t manage to get anything I meant to do last night done, so the poor kitties will have to live with a dirty litterbox until tonight. Anyone have any tips on how to prevent losing hours and hours to a video game?

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

So, aside from learning that Minecraft is dangerously addictive, I learned that, despite all being organized into neat little files, Cucumber tests all run together. It goes through all the step files when I run the tests, so when I solve And I click the "Login" button in the Account Creation steps, Admin Authentication can also use it when those steps run. For some reason it took Brandon three times explaining this for me to really grasp it. But! I think I have it now! The thing that was confusing me was that I would run my tests and one would fail that wasn’t actually in my list, which would throw me off.

I also learned that Github doesn’t count commits that are made to a branch in my little contributions map until the branch is merged into master. I set myself the goal of making at least one commit a day for the month of October, but it looks like I failed on the very first day! Booooo. Of course, I had planned to do a chapter of the Rails Tutorial when I got home, until Minecraft ate my evening.

Current streak: 0 days. *sob*

Current streak: 0 days. *sob* 

I need some kind of clever name for this goal. Commit October? Git October? Codetober? Some sort of horror movie reference about being committed (like to a mental institution?) Maybe that’s ableist. I’ve never been great at coming up with names. Any great ideas out there?

Today is labs day! This never actually means much to me since I mostly just continue whatever I was working on during the week, but there are more distractions. Derek, one of the previous apprentices who is now a junior dev is hosting a lunch and learn on Cucumber that I plan on attending, so hopefully I’ll learn more about how Cucumber and Capybara work. I’m working on the Admin Authentication tests, so I think that means I’m going to actually write some code and get the bookstore app really started.

Wouldn’t it be cool if I emerge from today an expert in Cucumber? Flying through my tests and crafting beautiful code and totally being a successful junior dev. Ahh.

SB Apprenticeship: Day 38

Ignore the mess, isn't my cat cute?

Ignore the mess, isn’t my cat cute?

  • What did you learn yesterday?
  • What are you going to do today?
  • What do you expect to learn?

Yesterday I managed to finish one of the Cucumber feature tests, felt awesome, started another and immediately felt lost again. Sigh. I should really have been more proactive with the TDD in code school. Hindsight! Still, I learned a lot about Cucumber and what it expects. I also put in my first real pull request for this assignment, and making the corrections that were requested also helped. I’m learning a lot every day, but it’s not really localized. Yesterday I learned a little about Cucumber, regex, pull requests, merging and Rails.

Today I’m pairing with Brandon again and probably working on the bookstore app. The feature set I’m working on in Cucumber is all about the book index store page, so I’m guessing that will involve writing the books controller and fiddling with the database.

I’m still a little confused when it comes to knowing exactly what an app requires me to write. For instance, right now, I wrote a test that makes a new book, then creates a new user and logs into the bookstore. I got this insane error message when I ran the tests, and I’m pretty sure that undefined method `create' for # (NoMethodError) means that I need to make a create method in my books controller. But then I look at David’s code, and he doesn’t have one. So I’m not sure if that means that for whatever reason his github isn’t up to date, or if he did something fancy that I don’t know. I should probably err on the side of doing what I know, even if it is less professional; that’s what refactoring is for, right? 🙂 This is what I mean when I say that I’m constantly second-guessing myself when it comes to knowing what to do. Maybe I just need to be more aggressive.