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
| fdfsd |
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
| Gems: | |
| event_calendar | |
| devise | |
| cancan | |
| + не нашел date_picker как гема, поэтому реализую jquery плагин | |
| Models: | |
| Event |
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> | |
| <head> | |
| <meta charset='utf-8'> | |
| <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
| <title>Popup Model</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <!--HTML5 Shiv--> |
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
| BudgetTransfer.blueprint do | |
| document_number { '1234' } | |
| name { 'test' } | |
| normalized_amount { (-1000 + rand(2000)).round(2) } | |
| description { 'for sure' } | |
| destination_bank { 'ОАО "ЛОГОВАЗ"' } | |
| destination_inn { '000000000000' } | |
| destination_bic { '000000000' } | |
| destination_bank { 'teh bank' } | |
| destination_correspondent_account { '00000000000000000000' } |
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
| xit "approves payment" do | |
| payment = Payment.last | |
| payment.update_attribute :signature_method, 'sms' | |
| payment.update_attribute :signature, '123456' | |
| post "/payments/#{payment.id}/approve.json" | |
| response.code.should == "422" | |
| post "/payments/#{payment.id}/approve.json", :payment => { |
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
| let!(:account) { Account.make! :user => $user } | |
| let!(:card) { Card.make! :account => account, :state => 'active' } | |
| =>(card.reissue_request.request) | |
| #<Request id: 1, user_id: 1, data_id: 1, data_type: "Requests::CardReissue", state: "in_progress", sms_enabled: true, unread: true, messages_count: nil, created_at: "2012-11-28 16:27:04", updated_at: "2012-11-28 16:27:04"> | |
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
| post "/cards/#{card.id}/block.json" | |
| response.code.should == "200" | |
| card.state.should == "blocking" |
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
| // -> quick_links_controller.rb | |
| def sort | |
| params[:quick_links].each do |index, quick_link| | |
| QuickLink.find(quick_link[:id]).update_attribute(:position, quick_link[:position]) | |
| end | |
| render :nothing => true | |
| end | |
| // quick_links_spec.rb |
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
| 1) Transport::CardsController should creates card | |
| Failure/Error: response.code.should == '200' | |
| expected: "200" | |
| got: "500" (using ==) | |
| # ./spec/requests/transport/cards_spec.rb:34:in `block (2 levels) in <top (required)>' | |
| вот такой фильтр в transport_controller | |
| before_filter(:only => :create) do | |
| begin |
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
| shared_examples_for :CRUD do |options| | |
| root_key = options[:klass].name.split('::').last.camelize(:lower) | |
| options[:index_path] ||= "/#{options[:klass].name.underscore.pluralize}" | |
| options[:show_path] ||= "#{options[:index_path]}/:id" | |
| options[:security_context] = $user if options[:security_context].nil? | |
| options[:model_pk] ||= :id | |
| index_path, show_path, actions = options[:index_path], options[:show_path], options[:actions] | |
| before :all do | |
| options.each{|k,v| instance_variable_set :"@#{k}", v } |
OlderNewer