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' | |
| RSpec.describe MoviesController, type: :controller do | |
| describe "PUT #update" do | |
| it "located the requested movie" do | |
| end | |
| it "changed the requested movies attributes" do | |
| end | |
| it "redirects to the updated movie" do | 
  
    
      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' | |
| RSpec.describe MoviesController, type: :controller do | |
| before (:each) do | |
| @mock_movie_attributes = {:title => 'Space Balls', :release_date => '24/6/1987', :rating => 'PG'} | |
| @mock_movie = FactoryGirl.create(:movie) | |
| end | |
| describe "PUT #update" do | |
| it "located the requested movie" do | 
  
    
      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' | |
| RSpec.describe MoviesController, type: :controller do | |
| describe "DELETE #destroy" do | |
| it "deletes the movie" do | |
| end | |
| it "redirects to the main page " do | |
| 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
    
  
  
    
  | require 'rails_helper' | |
| RSpec.describe MoviesController, type: :controller do | |
| before (:each) do | |
| @mock_movie_attributes = {:title => 'Space Balls', :release_date => '24/6/1987', :rating => 'PG'} | |
| @mock_movie = FactoryGirl.create(:movie) | |
| end | |
| describe "DELETE #destroy" do | 
  
    
      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 Hamming | |
| def self.compute(s1,s2) | |
| if s1.length != s2.length | |
| raise ArgumentError | |
| else | |
| index = 0 | |
| count = 0 | |
| while index < (s1.length) | |
| if s1[index] != s2[index] | |
| count += 1 | 
  
    
      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 Hamming | |
| def self.compute(s1,s2) | |
| distance = 0 | |
| raise ArgumentError if s1.length != s2.length | |
| s1.chars.zip(s2.chars) {|s1char, s2char| distance += 1 unless s1char == s2char} | |
| distance | |
| end | |
| 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 Hamming | |
| def self.compute(s1,s2) | |
| distance = 0 | |
| if s1.length != s2.length | |
| raise ArgumentError | |
| else | |
| s1.chars.zip(s2.chars) {|s1char, s2char| distance += 1 unless s1char == s2char} | |
| return distance | |
| 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
    
  
  
    
  | #include <stdio.h> | |
| #include <cs50.h> | |
| #include <math.h> | |
| int countDigits(long long num) { // helper method that counts the number of digits in a number | |
| int count = 0; | |
| while (num != 0) { | |
| num /= 10; | |
| ++count; | 
  
    
      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 credit_card_check() #main ruby method | |
| credit_card_no = 0 | |
| loop do #get credit card number | |
| puts "Number: " | |
| credit_card_no = gets.chomp | |
| size = credit_card_no.to_s.size | |
| break if size >= 13 && size <= 16 | |
| end | |
| cardValid = checkCredit(credit_card_no) | |
| if cardValid == false | 
  
    
      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 credit_card_check() #main ruby method | |
| credit_card_no = 0 | |
| until [13,14,15,16].include? credit_card_no.to_s.size #get credit card number | |
| puts "Number: " | |
| credit_card_no = gets.chomp | |
| end | |
| cardValid = checkCredit(credit_card_no) | |
| if cardValid == false | |
| puts "INVALID" |