Skip to content

Instantly share code, notes, and snippets.

View thiagoramos23's full-sized avatar

Thiago Ramos thiagoramos23

View GitHub Profile
@thiagoramos23
thiagoramos23 / EXTableViewCell.m
Last active August 29, 2015 14:07
layoutSubviews
//
// ExTableViewCell.m
// TableViewExample
//
// Created by Thiago Ramos on 10/3/14.
// Copyright (c) 2014 br.com.exemplo.tableview. All rights reserved.
//
#import "ExTableViewCell.h"
//
// EXTableViewController.m
// TableViewExample
//
// Created by Thiago Ramos on 9/30/14.
// Copyright (c) 2014 br.com.exemplo.tableview. All rights reserved.
//
#define CELL_ID @"ExampleTableViewCellID"
#define CELL_HEIGHT 44.0f
@thiagoramos23
thiagoramos23 / JSPostAdapter.m
Created October 10, 2014 17:18
JSPostAdapter.m
//
// JSPostAdapter.m
// JSONModelExample
//
// Created by Thiago Ramos on 10/9/14.
// Copyright (c) 2014 br.com.exemplo.jsonmodel. All rights reserved.
//
#define URL_POSTS @"http://10.1.1.101:3000/posts.json"
@thiagoramos23
thiagoramos23 / JSComment.h
Created October 10, 2014 17:20
Domain JsonModelExample
//
// JSPost.h
// JSONModelExample
//
// Created by Thiago Ramos on 10/9/14.
// Copyright (c) 2014 br.com.exemplo.jsonmodel. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "JSONModel.h"
@thiagoramos23
thiagoramos23 / ViewController.m
Created October 10, 2014 17:20
ViewController JSONModelExample
//
// ViewController.m
// JSONModelExample
//
// Created by Thiago Ramos on 10/9/14.
// Copyright (c) 2014 br.com.exemplo.jsonmodel. All rights reserved.
//
#import "ViewController.h"
#import "JSPostAdapter.h"
@thiagoramos23
thiagoramos23 / index_residences_spec.rb
Created October 23, 2014 10:04
Index action Spec
require 'rails_helper'
RSpec.describe Admin::ResidencesController do
let(:user) { build_stubbed(:user) }
let(:residence_101) { build_stubbed(:residence) }
let(:residence_102) { build_stubbed(:residence) }
context 'Valid User' do
before {
sign_in user
@thiagoramos23
thiagoramos23 / create_residence_spec.rb
Created October 23, 2014 10:05
Create Residence Spec
require 'rails_helper'
RSpec.describe Admin::ResidencesController do
let(:user) { double('user') }
let(:valid_params) { attributes_for(:residence) }
context "Valid User" do
let(:setup) {}
before {
@thiagoramos23
thiagoramos23 / destroy_residence_spec.rb
Created October 23, 2014 10:05
Destroy Residence Spec
require 'rails_helper'
RSpec.describe Admin::ResidencesController do
let(:setup) {}
let(:user) { double('user') }
let(:residence_101) { build_stubbed(:residence) }
context "Valid User" do
before {
@thiagoramos23
thiagoramos23 / edit_residence_spec.rb
Created October 23, 2014 10:05
Edit Residence Spec
require 'rails_helper'
RSpec.describe Admin::ResidencesController do
let(:user) { build_stubbed(:user) }
let(:get_action) { get :edit, id: residence_101.id }
let(:residence_101) { build_stubbed(:residence, id: 1) }
context "#valid_user" do
let(:setup) {
allow(Residence).to receive(:find).with(residence_101.id.to_s)
@thiagoramos23
thiagoramos23 / new_residence_spec.rb
Created October 23, 2014 10:06
New Residence Spec
require 'rails_helper'
RSpec.describe Admin::ResidencesController do
let(:user) { build_stubbed(:user) }
context "#valid_user" do
describe '#new' do
before {
sign_in user