Skip to content

Instantly share code, notes, and snippets.

require_relative 'integration_test_helper'
class BannerTest < FeatureTest
def test_user_can_see_banner
require_js
visit '/'
# binding.pry
assert page.find('#banner')
end
def invoice
repository.engine.invoice_repository.find_by('id', self.invoice_id)
end
1. What's the difference between a cookie and a session?
A cookie is a marker that connects to the session, and had some stringfied data typicall in a JSON type object, Session is a domain concept.
2. What's serialization and how does it come into play with cookies?
Is stringifying an object, then it turns your object into strings
3. Can a cookie be shared by more than one user? How/why?
Cookies gets stored on a machine, so it can be used by more than one person but shouldn't be.
4. What would it mean to store a shopping cart in a cookie?
Less DB load, lose cross device availability
5. What advantages/disadvantages are there between cookie-stored carts and
database-stored carts?
@BobGu
BobGu / left_to_do
Last active August 29, 2015 14:05
Okay so as of Saturday at 1:45pm, here are the features that need to be addressed:
Authorization
Seperating out the orders views for the customer and the admin
-Emily
In Authenticated Non-Admins:
1. What does it mean for an application to be multi-tenant?
Tenant is like someone one that lives in a house and we want to build a house that has many tenants, that has access to all
the things in the house but it's own separate room. They can all use things like the bathroom and kitchen and share those things together.
2. Why would you want to build an application to be multi-tenant?
You can do work for multiple clients and charge them all by just building one app!
3. How do you implement multi-tenancy at the data / database level?
Have different tables for different 'stores'
[If this project gets selected, put **SELECTED** here]
#### Pitch
[1 sentence that explains the value proposition of the application. How would
you explain it to a potential business partner, team member, or investor?]
A set of tools to dominate your weekly or yearly fantasy football league.
#### Description
@BobGu
BobGu / Error
Created September 30, 2014 21:03
ActiveRecord::AdapterNotSpecified (database configuration does not specify adapter):
@BobGu
BobGu / f.select
Created September 30, 2014 23:09
<%= f.select(:categories, options_from_collection_for_select(Category.all, "name", "name", @item.categories.pluck(:name)),
{}, {multiple: true, size: Category.all.count}) %>
#this set up omniauth fake data
#also this allows us to stub or double the current_user method and return the User.last instead of nil
before(:each) do
set_omniauth()
ApplicationController.any_instance.stub(:current_user).and_return(User.last)
end
def require_js
Capybara.current_driver = :selenium
end