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 index | |
| @people = People.all | |
| respond_to do |format| | |
| format.html | |
| format.xml { render xml: @people.to_xml } | |
| end | |
| 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 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 |
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
| 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 |
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
| FactoryGirl.define do | |
| factory :channel do | |
| name | |
| end | |
| 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
| ... | |
| it "should show another channels" do | |
| channels = FactoryGirl.build_list(:channels) | |
| channels_view = app.view('channels') | |
| channels_view.show_another_channels(channels) | |
| 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
| gem 'factory_girl' | |
| spec_helper.rb: | |
| .... | |
| FactoryGirl.find_definitions |
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 Channels < Clutter::Group | |
| dsl do |o| | |
| # some markup here | |
| end | |
| def show_channels(channels) | |
| # some actions with dom here | |
| end | |
| 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
| class Channel | |
| include Virtus | |
| atribute :id, Integer | |
| attribute :name, String | |
| 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
| describe "Channels Api Controller" do | |
| it "should get all channels from api" do | |
| stub_requested = stub_request(:get, channels_api_url). | |
| with(body: { credentials: credentials }). | |
| to_return(status: 200, body: load_fixture('channels.json'), headers: {}) | |
| channels_api_controller = app.controller('api/channels_controller') | |
| channels_api_controller.all_channels.on_complete do |models| |
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 Api::ChannelsController < CS::Base::Controller | |
| def all_channels | |
| SFK::Http.get(channels_url, options).transform do |data| | |
| parse_data(models) | |
| end | |
| end | |
| def parse_data(data) | |
| models = [] |