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 'rails_helper' | |
require 'koala' | |
feature 'Login using facebook' do | |
before do | |
@test_users_api=Koala::Facebook::TestUsers.new(:app_id =>FB_APP_ID , :secret =>FB_SECRET_KEY) | |
@test_user=@test_users_api.create(false) | |
end | |
after do | |
@test_users_api.delete(@test_user["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
#This program produces the expected result in less number of iteration. | |
x=*(0...100) | |
x.each do |y| | |
str=y.to_s | |
removed_last_digit=str[0..-1] | |
s=removed_last_digit.split('').collect(&:to_i).reduce(:+) | |
if s<=7 | |
diff=7-s | |
number=str.to_s+diff.to_s |