Well first off you are looking at the wrong line in your rspec backtrace. It's where the error gets thrown in the rspec code, not what actually is causing it. You should run rspec with the -b option to get actual backtraces from your code.
Also an easier way to write this would be:
# assuming you pass in nil, not "", so #compact would work
def full_title(page_title = nil)
["Ruby on Rails Tutorial Sample App", page_title].compact.join(" | ")
end
Alternative way, so it handles blank arguments as well:
def full_title(page_title)
title = ["Ruby on Rails Tutorial Sample App"]
title << page_title if page_title.present?
title.join(" | ")
end
As for the original issue - i think it's your inconsistent return points.