Code samples, a small test, interview 1, interview 2, offer is pretty standard.
But that 'small test' is usually 45 minutes to an hour of programming, not a weeks worth of work.
You're not stupid for thinking they might use what you created. How did you license it on github?