Skip to content

Instantly share code, notes, and snippets.

View igkuz's full-sized avatar

Igor Kuznetsov igkuz

  • Tiny
  • Valencia, Spain
View GitHub Profile
gem 'factory_girl'
spec_helper.rb:
....
FactoryGirl.find_definitions
@igkuz
igkuz / 1.rb
Last active December 17, 2015 14:39
...
it "should show another channels" do
channels = FactoryGirl.build_list(:channels)
channels_view = app.view('channels')
channels_view.show_another_channels(channels)
end
...
FactoryGirl.define do
factory :channel do
name
end
end
@igkuz
igkuz / gist:5670054
Last active December 17, 2015 20:48
git branch develop
git flow feature start 00001_my_super_feature
git co staging
git merge feature/00001_my_super_feature
bundle exec rake
git push
git flow feature finish 00001_my_super_feature
def fill_view(models, active_index)
if models.count > 0
@broadcast.truncate
@items = models
@current_item_index = active_index
@current_item = models[active_index]
if models[0].is_a?(Channel)
@channel_info_area_logo.props.url = @current_item.small_logo
@channel_info_area_text.props.text = @current_item.name
hide_episode_description
def index
@people = People.all
respond_to do |format|
format.html
format.xml { render xml: @people.to_xml }
end
end
json.meta do |json|
json.total @lists.total_count
json.num_pages @lists.num_pages
json.per_page @per_page
end
json.items @lists do |json, list|
json.partial! "maillist", maillist: list
end
@igkuz
igkuz / schema.json
Last active December 18, 2015 11:38
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Product",
"description": "List object",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a product",
"type": "integer"
},
config.exceptions_app = self.routes
match '/404', :to => "errors#not_found"
match '/500', :to => "errors#internal_error"
match '/422', :to => "errors#unprocessable_entity"