This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails new ptsspree20_static_test | |
cd ptsspree20_static_test | |
echo "ruby-1.9.3" >.ruby-version | |
echo "ptsspree20_static_test" >.ruby-gemset | |
rvm gemset delete ptsspree20_static_test | |
rvm gemset create ptsspree20_static_test | |
rvm gemset use ptsspree20_static_test | |
echo "gem 'spree', '2.0.0'" >> Gemfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app="mthosts"> | |
<head> | |
<title>mysite<%= @title.nil? ? "" : " | #{@title}" %></title> | |
<%= stylesheet_link_tag "application", :media => "all" %> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<link href="//netdna.bootstrapcdn.com//twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" rel="stylesheet"> | |
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def edit | |
@publication = Publication.find(params[:id]) | |
@recipients = @publication.users | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def edit | |
@publication = Publication.find(params[:id]) | |
@recipients = @publication.users | |
@users = User.first | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rake minitest:all | |
NOTICE: CREATE TABLE will create implicit sequence "roles_id_seq" for serial column "roles.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "roles_pkey" for table "roles" | |
NOTICE: CREATE TABLE will create implicit sequence "shift_types_id_seq" for serial column "shift_types.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "shift_types_pkey" for table "shift_types" | |
NOTICE: CREATE TABLE will create implicit sequence "shifts_id_seq" for serial column "shifts.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "shifts_pkey" for table "shifts" | |
NOTICE: CREATE TABLE will create implicit sequence "sys_configs_id_seq" for serial column "sys_configs.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "sys_configs_pkey" for table "sys_configs" | |
NOTICE: CREATE TABLE will create implicit sequence "users_id_seq" for serial column "users.id" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------- | |
class MyObj < ActiveRecord::Base | |
attr_accessor :i_can_select | |
end | |
# ---------------------- | |
class MyController < ApplicationController | |
def index | |
@list = MyObj.all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the code is unfinished as of yet, this is as far as we got during the meeting | |
class Parser | |
def initialize filename, delimiter="," | |
@fhandle = File.open(filename, 'r') | |
@delim = delimiter | |
@header = [] | |
@arr_val = [] | |
line_str = @fhandle.readline | |
@header = parse_row(line_str) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/spec' | |
require 'minitest/autorun' | |
describe 'Game' do | |
it 'should have 3 pegs' do | |
game = Game.new | |
game.pegs.count.must_equal 3 | |
end | |
it 'should have 3 discs by default' do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm trying to test the controller - to make sure that a logged in user who is not an admin user, cannot look at another users show page, and that they can look at their own. | |
I'm beginning to suspect that this testing is really only relevant inside the policy tests and that I have to assume that the controllers are following the policies as described. | |
The system uses: | |
Rails 4.2.1 | |
Minitest | |
Devise | |
Pundit | |
Rolify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a model that looks like: | |
# == Schema Information | |
# | |
# Table name: vendors | |
# | |
# id :integer not null, primary key | |
# company_name :string | |
# category :string | |
# |
OlderNewer