Giter VIP home page Giter VIP logo

climbalytics's People

Contributors

crawfoal avatar tjdolan121 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

climbalytics's Issues

Make a guide (or even generator) for new applications

Review what I've done in this application and write a guide that includes things like

  • install RSpec, FactoryGirl, Capybara, Selenium, etc
  • setting up users, roles, and authorization
  • generalize some of the tests and create templates (or even a generator for them)
    Maybe make a rake task to some of this stuff.

Create seed data for development environment

This will be used to provide a better development experience. It will be easier to design the appearance of the webpages, and the flow through them if we have some realistic data. It can also be used to test data migrations when we get to that point.

Restructure the "Edit User" page

  • Call it "Edit Profile" instead of "Edit User"
  • Address issue #21
  • Use two columns on sm through lg screens so that we don't have a bunch of whitespace to the right
  • Make sure that the "Current password" field and the "Update" button are separated from the rest of the form in a way that makes it obvious that those two items apply to the page as a whole and not just to the last section. E.g. I don't feel like it is obvious that they need to fill this in when changing email.

Create sketch/outline for athlete dashboard

  • Review the outline in ClimbalyticsPlan.md for the athlete dashboard and add anything else you think would be helpful.
  • Modify app/views/users/dashboards/athlete.html.erb to have the basic html structure we'll use for this. For example, say you think we should have each of those three lists in their own wells - make the wells and any headers, etc you think you might need. Eventually, we'll make templates that we can render in each of those wells, below the header (wells/headers are just examples here - you should look around and come up with what you think will look best).

Revisit spec for BouldersController#destroy

In the code below

describe BouldersController do
  ...
    context 'when the user owns the boulder problem' do
      define_roles(:setter)
      login_user(:setter_user)
      let(:boulder) { current_user.setter_story.boulders.create(attributes_for(:boulder)) }

      it 'deletes the boulder from the database' do
        boulder # lazy evaluation causes this test to fail if the boulder isn't created before the proc below is evaluated
        expect { delete :destroy, id: boulder.id }.to change(Boulder, :count).by(-1)
      end
      it 'redirects to the boulders index' do
        delete :destroy, id: boulder.id
        expect(response).to redirect_to boulders_path
      end
      it 'displays a flash message' do
        delete :destroy, id: boulder.id
        expect(flash[:notice]).to eq 'Boulder was successfully destroyed.'
      end
    end
  ...
end

Can the http request be saved as a lambda, and then this lambda be passed to the expect in the first example? Then the other two could call it before running their expectation. Even better, I should create a shared example for a request that redirects to a specified action and displays a flash message.

Use the implicit/explicit subject where it makes sense

Particularly, where it would allow you to use is_expected.to (in the case of the implicit subject). If you use the explicit subject, make sure to name it (don't actually use subject to refer to the subject in the code).

Use `specify` instead of `it` where it makes sense

Review the specs for simple examples where the code looks like plain English; use specify instead of it for these. An example of a good candidate (from The Rails 4 Way) is

describe BlogPost do
  let(:blog_post) { BlogPost.new title: 'foo' }

  it "to not be published" do
    expect(blog_post).to_not be_published
  end
end

This could instead be written as

describe BlogPost do
  let(:blog_post) { BlogPost.new title: 'foo' }
  specify { expect(blog_post).to_not be_published }
end

Define athlete_story model

  • should belong to a user
  • should be created when user is first assigned a role of "athlete"
  • should have many boulder_logs

`id` attributes are permitted for various models

I can't remember why I did this (I remember having a reason...), but I want to test what happens when an id is passed in the params hash and it matches an id of an existing record (specifically that of one owned by another user during a update action)... is the record updated?

Use the change matcher more

For the change matcher, there is the classic example:

expect { BlogPost.create title: 'Hello' }.to change( BlogPost, :count).by( 1)

but I know I could be using this in more cases. Here is just one example (from The Rails 4 Way) to keep in mind:

describe "#publish!" do
  let(:blog_post) { BlogPost.create title: 'Hello' }

  it "updates published_on date" do
    expect { blog_post.publish! }.to change { blog_post.published_on }.from(nil).to(Date.today)
  end
end

Define sessions model

  • fields for high point, notes, and date (use the auto created column)
  • belongs to a boulder_log
  • cannot actually be named sessions (devise has a model named that)

Define boulder_log model

  • belongs to an athlete story
  • fields for grade, style, rating, notes (private), comments (public), project (a boolean)
  • should have many sessions
  • when a user first logs a climb (i.e. creates a boulder_log record), the first session should be created (and obviously the date_created will be populated); they can optionally fill in session details

Zip code field should not have increment/decrement button

In the edit profile page, the zip code should not have the buttons for incrementing/decrementing a number. It is there because the field is a type of number; we should probably keep the input type on the field as number because I think that this is what makes smart phones pull up the special numbers only keyboard. Instead of changing the input field type, maybe we can just get that decoration/styling aspect to go away?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.