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.

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.

SB Apprenticeship: Day 37

Cucumber tests!

Cucumber tests!

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

Yesterday I worked through a bunch of Cucumber tests. They’re kind of weird, sometimes the answer is dead simple, but other times it’s super complicated. It still takes me some time to figure out which is called for in each individual test, I spent like half an hour on the click one yesterday.

Simple, not so simple

Simple, not so simple

I’m also still not sure how complete the Cucumber tests are supposed to be. Is this like when we did Battleship at TIY, once all the tests are passing I’ll have a finished app? Brandon mentioned that I’ll need to have some Rspec tests in there too (that I’ll write myself), but I’m not sure what they’ll cover? I haven’t actually written any real code for this app yet, it’s all been installing gems and making tests pass. I guess it’ll all get clearer as I go, though.

Today I’m going to read more of the Cucumber book and then work on the bookstore app. I keep meaning to ask Kevin to explain scoring in bowling to me so I can work on the kata, but I always forget by the time I get home. I feel like I’m not accomplishing anything during my days, and that’s stressing me out. I think sometimes I have a hard time actually beginning projects — like, I have this feeling that if I just read this one more thing, or do that one more tutorial all of a sudden everything will fall into place and I’ll be the brilliant coder that everyone seems to think I can be. Unfortunately I don’t think that’s how it works, though. I don’t know. It’s really hard for me to get started, I never really feel like I have any idea what’s going on. Sometimes I ask too many questions about things that are actually easy and other times I feel like something’s got to be simple and waste hours trying to figure out a solution before asking someone. Yesterday I spent way too long trying to figure out how David knew to use ActionMailer in something, and when I finally asked it turned out that he had just installed a gem. Although honestly, I wouldn’t have even known that I needed ActionMailer if I hadn’t peeked at his code in the first place. Do you just learn this stuff as you go? Is there some intuition that I’m missing? I really like this job, and Brandon told me that I’m progressing at a good pace, but I feel like I’m behind and my stupid brain immediately goes to “you’re going to fail and they’ll never hire you and you’ll never get a job and you’re a miserable failure why do you even try anything new.” Which isn’t exactly useful in any sense. I’ve gotten better at shutting that off, but it’s hard when I’m sitting in front of my computer feeling stupid.

Sigh. I kind of feel like Rumsfeld’s 2002 beat poem:

“There are known knowns; there are things we know we know. We also know there are known unknowns; that is to say we know there are some things we do not know. But there are also unknown unknowns – the ones we don’t know we don’t know.”

I know there are things I don’t know, but what about all the things I don’t know that I don’t know yet?

I have no idea what I expect to learn today.

SB Apprenticeship: Day 36

I have blue hair, a red panda skirt and a job that doesn't care at all about either. I'm definitely adulting right.

I have blue hair, a red panda skirt and a job that doesn’t care at all about either. I’m definitely adulting right.

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

Why am I still having problems with Github? I’m ok with creating a new repo on the site, and I’m ok once I get it linked up to my laptop, but the process of connecting the two is fraught with indecision for me. I have to either look it up or ask every time. Sigh. It’s like everything involving me and coding: once I get started I’m generally ok, but getting started is always a big pain. I wonder how long it takes for that to go away?

Yesterday Brandon and I set up my project, got Devise installed and passed a whole bunch of the Cucumber tests. I didn’t realize that this was going to be similar to the Battleship project at TIY; they wrote all the tests and I have to make them pass. It’s still a lot of work, but there’s some guidance, and that makes me feel better. I still can’t really imagine *working* as a coder, like coming in in the morning and sitting down to program. Just knowing what to do. I guess that’s where Agile and meetings and stuff come in, but it’s all still a bit foreign to me. Devise is pretty cool, there’s a lot going on under the hood there and I think it’s going to make my life a lot easier. It was also easier to set up than I thought; there were a lot of steps, but the readme was clear and there was never a part where I felt lost or confused.

Today I’m going to read up on Capybara and work more on the bookstore, at least in between meetings. I signed up for the blogging task force, and there’s the initial meeting for that at 11, then at noon there’s a lunch and learn about the new HR policies. I’ll at least have the whole afternoon to work, though. I’m looking forward to being on the blogging task force, I’ve been enjoying writing here every day. I’m still not sure if I should be putting all that behind me and focusing solely on coding, but I guess I’ll figure all that out.

I expect to learn more about how Capybara works with Cucumber. The test suite I’m working on now is all the account creation stuff, so I think it will be fairly familiar.

SB Apprenticeship: Day 35

Turns out you shouldn't leave your water on the floor unaccompanied when there's a dog around. :)

Turns out you shouldn’t leave your water on the floor unaccompanied when there’s a dog around. 🙂

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

Monday! I’ve never been one of those Garfield people, but I will admit to dragging this morning. Blerg.

Friday I didn’t end up pairing with Brandon because I signed up to help out with a labs project that ended up taking more time than I anticipated. I was able to make a lucidchart to diagram out the bookstore project, which made it look a lot less involved than I thought, but that was about the extent of the work I managed to get done on Friday.

Relationship chart for my bookstore app.

Relationship chart for my bookstore app.

Today I’m going to work on the bowling kata in the morning and pair with Brandon at 1 to start working on the bookstore app. He said he would help me with the initial Devise stuff, which I think will be helpful. I don’t think Devise is hard, there’s just a lot of moving parts, and having someone who knows it really well will help. I’m still a little nervous about this app, I feel very unprepared, but I’m sure it’ll be fine and I’m just being paranoid.

What do I expect to learn…I think that there is probably some best practice that I’m not doing when it comes to starting new projects, and Brandon is great for showing those. Hopefully I’ll learn Devise to the point where I can use it again and not have to be walked through it. And I think today is the day I start figuring out Cucumber and Capybara. Moar testing frameworks!